Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
p30
//Title of this code //gcc 4.8.2 #include <stdio.h> #define MAXLINE 1000 /* maximum input line length */ int getline(char line[], int maxline); void copy(char to[], char from[]); int getline(char s[], int lim) { int c,i; for(i=0;i<lim-1 && (c=getchar())!=EOF && c!='\n';i++ ){s[i]=c;} // ++i; s[i]='\0'; return i; } void copy(char lgst[],char l[]) { int i; for(i=0;l[i]!= '\0';i++){lgst[i]=l[i];//printf("%d",longest[i]); } //printf('\n'); // l[i]="\0"; } int main(void) { int max=0,apel=0; char line[MAXLINE];//current char longest[MAXLINE]; //--------------------------------------- while((apel=getline(line ,MAXLINE)) > 0) if(max<=apel){max=apel; copy(longest,line); } // else printf("%s",longest); for(int i=0;longest[i]!= '\0' && longest[i]!= '\n';i++)printf("%c",longest[i]); //--------------------------------------- // //--------------------------------------- return 0; }
run
|
edit
|
history
|
help
0
reverse function
005#
12535
perfect square
PrintShapePointer
InviteList
Ultimo intento
Microsoft - MaxEmployeeAttendence (R repititions - Semi Optimised DP)
Six Trigonometric Functions
string-Orderly words