MCPcopy Create free account
hub / github.com/codemistic/Data-Structures-and-Algorithms / main

Function main

CPP/char array/largestr.cpp:9–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#define endl '\n'
8
9int main(){
10 cin.tie(0)->sync_with_stdio(0);
11 int n;
12 cin>>n;
13 cin.get();
14 char a[1000];
15 char largest[10000];
16 int large=0;
17 while(n--){
18 cin.getline(a,1000);
19 int ln;
20 ln=strlen(a);
21 if(ln>large){
22 large=ln;
23 strcpy(largest,a);
24 }
25 }
26 cout<<largest<<endl;
27 return 0;
28}
29
30

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected