September 2021 0 6 Report
Написать этому коду блок-схему #include

using namespace std;

bool check(string &s){

for(auto &i : s)

if(!(i >= '0' && i <= '9'))

return false;

return true;

}

int sum_n(int k){

return (1 + k)*k/2;

}

signed main(){

string n;

cin >> n;

check(n) ? cout << sum_n(stoi(n)) : cout << "n is wrong";

}
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.