Home
О нас
Products
Services
Регистрация
Войти
Поиск
елена1201
@елена1201
August 2022
1
13
Report
решите, пожалуйста в си++
Please enter comments
Please enter your name.
Please enter the correct email address.
Agree to
terms of service
You must agree before submitting.
Send
Answers & Comments
Nata9911
#include <iostream>
using namespace std;
int main () {
int k, sum = 0;
cout << "Введите число, большее 1: " << endl;
cin >> k;
if(k < 1){
cout << "Некорректный ввод." << endl;
}
else{
for(int i = 1; i <= k; ++i) {
sum += i; }
cout << "Сумма = " << sum << endl;
}
}
1 votes
Thanks 2
елена1201
спасибо большое
×
Report "решите, пожалуйста в си++..."
Your name
Email
Reason
-Select Reason-
Pornographic
Defamatory
Illegal/Unlawful
Spam
Other Terms Of Service Violation
File a copyright complaint
Description
Helpful Links
О нас
Политика конфиденциальности
Правила и условия
Copyright
Контакты
Helpful Social
Get monthly updates
Submit
Copyright © 2025 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
using namespace std;
int main () {
int k, sum = 0;
cout << "Введите число, большее 1: " << endl;
cin >> k;
if(k < 1){
cout << "Некорректный ввод." << endl;
}
else{
for(int i = 1; i <= k; ++i) {
sum += i; }
cout << "Сумма = " << sum << endl;
}
}