fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. //freopen("tin9.txt","r",stdin);
  6. //freopen("tout9.txt","w",stdout);
  7. int ch = 0;
  8. string str;
  9. getline(cin,str);
  10. while( str != "DONE")
  11. {
  12. int detect = 1;
  13. //cout<<str<<endl;
  14. for(int i=0;i<str.length();i++)
  15. {
  16. if(detect == 1)
  17. {
  18. detect =0;
  19. if(str[i] >='a' && str[i] <='z')
  20. {
  21. str[i] = toupper(str[i]);
  22. ch++;
  23. cout<<str[i];
  24. continue;
  25. }
  26. else if(!(str[i] <='Z' && str[i] >='A'))
  27. {
  28. ch++;
  29. detect = 1;
  30. continue;
  31. }
  32. }
  33. else
  34. {
  35. if(str[i] >='A' && str[i] <='Z')
  36. {
  37. str[i] = tolower(str[i]);
  38. ch++;
  39. cout<<str[i];
  40. continue;
  41. }
  42. }
  43. if(str[i]<='9'&& str[i] >='0')
  44. {
  45. ch++;
  46. }
  47. else if(str[i] == '.')
  48. {
  49. if(i!= str.length()-1)
  50. ch++;
  51. cout<<str[i]<<endl;
  52. detect = 1;
  53. }
  54. else
  55. {
  56. cout<<str[i];
  57. }
  58. }
  59. //cout<<endl;
  60. getline(cin,str);
  61. }
  62. if(ch == 0)
  63. cout<<"eh saala cup namde"<<endl;
  64. return 0;
  65. }
  66.  
Time limit exceeded #stdin #stdout 5s 4560KB
stdin
Standard input is empty
stdout
Standard output is empty