Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 01_01_Task1_Secret.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include <iostream> //for std::cout
- #include <string>
- #include <iomanip>
- #include <cctype> //char toupper, tolower
- using namespace std;
- int main()
- {
- cin.sync_with_stdio(false);
- cout.sync_with_stdio(false);
- char ch;
- cin >> ch;
- int sum = 0;
- while (ch != '.')
- {
- if (isdigit(ch))
- {
- sum += ch - 48;
- }
- cin >> ch;
- }
- if ((sum >= 65 && sum <= 90) ||
- (sum >= 97 && sum <= 122))
- {
- cout << (char)sum << endl;
- }
- else
- {
- cout << sum << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement