Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdlib.h>
- #include<stdio.h>
- #include<string.h>
- #define SIZE 1000
- int main()
- {
- FILE *f;
- f=fopen("linie.txt","r");
- char linie[SIZE];
- int nr=0,p,l=0;
- while(fgets(linie,SIZE,f))
- {
- nr++;
- if(strlen(linie)>l) {l=strlen(linie);p=nr;}
- }
- printf("linia %d este cea mai lunga",p);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement