UVA 12543 - Longest Word Shipu Ahamed - 01 Sep 2020 Problem PDFSolution:#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define ll long long #define sc scanf #define pf printf #define Pi 2*acos(0.0) int main() { char s[1000005],a[1000005]; int max=1; while(sc("%s",s)) { if(!strcmp(s,"E-N-D")) break; int l=strlen(s); int c=0; for(int i=0;i='a'&&s[i]<='z'||s[i]>='A'&&s[i]<='Z'||s[i]=='-') continue; else c++; } l=l-c; if(max='A'&&a[i]<='Z') pf("%c",a[i]+32); else if(a[i]>='a'&&a[i]<='z'||a[i]=='-') pf("%c",a[i]); } pf("\n"); return 0; } https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/12543/12543.cpp