Untitled
unknown
c_cpp
a year ago
624 B
0
Indexable
Never
#include <iostream> #include <cmath> #include <string> using namespace std; int main() { string str; int count_plus = 0, count_minus = 0, count_dote_2 = 0; cin >> str; for (int i = 0; i < str.length(); i++) { if (str[i] == '.') { count_dote_2++; str[i] = 'a'; }else if (str[i] == '+') { count_plus++; } else if (str[i] == '-') { count_minus++; str[i] = '+'; } } cout << count_plus << " " << count_minus << " " << count_dote_2 << "\n"; cout << str; return 0; }