Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- setlocale(0,"");
- string st;
- cout<<"введи строку - St"<<endl;
- getline(cin, st);
- int n = st.length();
- int k = n;
- bool lstChetn = 0;
- for (int i = 0; i < n; i++)
- {
- if(st[i]<'0'||st[i]>'9') continue;
- if(((st[i]-'0')%2)==0)lstChetn=1;
- else lstChetn=0;
- }
- if(lstChetn) cout<<"Chetnoje";
- else cout << "Nechetnoje";
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement