Created
October 5, 2015 23:44
-
-
Save huseyin/e8f7089d72aac51755e8 to your computer and use it in GitHub Desktop.
gece esintisi bir kod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX_LINE_LENGTH 81 | |
#define MAX_BYTE_LENGTH 512 | |
int main(void) | |
{ | |
char kr; | |
char buffer[MAX_BYTE_LENGTH]; | |
int i, counter = 0; | |
while ((kr = getchar()) != EOF) | |
{ | |
buffer[counter] = kr; | |
counter++; | |
} | |
buffer[counter] = '\0'; | |
for (i=0; i <= counter; i++) | |
{ | |
if (i != 0 && (i % MAX_LINE_LENGTH) == 0) | |
printf("\n%c", buffer[i]); | |
else | |
printf("%c", buffer[i]); | |
} | |
return EXIT_SUCCESS; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ne işe yarar ?
Aklımda iken test çıktısını da vereyim. Kernighan kitabını kurcalar iken gördüğüm bir problem idi. Ayrıntılı ele alınabilirdi ama:
- Efendim ahval -i vakt "2015-10-06 02:52:46 +0300" olunca bu kadar oluyor herhalde :)
Girdi:
Beklenen Çıktı: