Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<stdlib.h>
  2. #include<stdio.h>
  3. #include<string.h>
  4.  
  5. #define SIZE 1000
  6.  
  7. int main()
  8. {
  9. FILE *f;
  10. f=fopen("linie.txt","r");
  11. char linie[SIZE];
  12. int nr=0,p,l=0;
  13. while(fgets(linie,SIZE,f))
  14. {
  15. nr++;
  16. if(strlen(linie)>l) {l=strlen(linie);p=nr;}
  17. }
  18. printf("linia %d este cea mai lunga",p);
  19. return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement