Advertisement
Guest User

Untitled

a guest
Dec 9th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.26 KB | None | 0 0
  1. #define _USE_MATH_DEFINES
  2. #include <string>
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <iomanip>
  6. #include <fstream>
  7. #include <deque>
  8. #include <queue>
  9. #include <vector>
  10. #include <cstdlib>
  11. #include <set>
  12. #include <iostream>
  13. #include <cctype>
  14.  
  15. using namespace std;
  16.  
  17.  
  18. size_t getCharSize(char* ptr) {
  19.     return sizeof(ptr);
  20. }
  21.  
  22. int main() {
  23.  
  24.     ifstream in("input.txt");
  25.     ofstream out("output.txt");
  26.  
  27.     int d, m, y;
  28.     char c;
  29.     in >> d >> c >> m >> c >> y;
  30.  
  31.     char sd[1000],sm[1000],sy[1000];
  32.  
  33.      
  34.     _itoa_s(d, sd, d + 1);
  35.     _itoa_s(m, sm, d + 1);
  36.     _itoa_s(y, sy, d + 1);
  37.  
  38.  
  39.  
  40.      if (d >= 8) {
  41.         int i = 0;
  42.         while(sd[i] != '\0'){
  43.             if (islower(sd[i])) {
  44.                 sd[i] = toupper(sd[i]);
  45.             }
  46.             i++;
  47.         }
  48.         i = 0;
  49.         while (sm[i] != '\0') {
  50.             if (islower(sm[i])) {
  51.                 sm[i] = toupper(sm[i]);
  52.             }
  53.             i++;
  54.         }
  55.         i = 0;
  56.         while (sy[i] != '\0') {
  57.             if (islower(sy[i])) {
  58.                 sy[i] = toupper(sy[i]);
  59.             }
  60.             i++;
  61.         }
  62.     }
  63.  
  64.     out << sd << '/' << sm << '/' << sy;
  65.  
  66.     in.close();
  67.     out.close();
  68.     return 0;
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement