Advertisement
egormerk

Capitalization

Apr 12th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     int N, k = 0;
  9.     cin >> N;
  10.     char a;
  11.     a = getchar();
  12.     string s = "";
  13.     if (N > 0) {
  14.     for (int i = 0; i < 100; i++) {
  15.         a = getchar();
  16.         if (a == '\n') break;
  17.         if (a == ' '){
  18.            s+=a;
  19.            k = 0;
  20.            continue;
  21.         }
  22.         if ((k == 0) and (a > 96)) s+=a-32;
  23.         if ((k == 0) and (a < 96)) s+=a;
  24.         if ((k > 0) and (a > 96)) s+=a;
  25.         if ((k > 0) and (a < 96)) s+=a+32;
  26.         k++;
  27.     }}
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement