#include <iostream>
using namespace std;
void SumNumbers(int N) {
int _sum = 0;
for (int i = 1; i <= N; i++)
{
_sum += i;
}
cout << _sum;
signed main() {
setlocale(LC_ALL, "Rus");
int N;
cin >> N;
SumNumbers(N);
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
void SumNumbers(int N) {
int _sum = 0;
for (int i = 1; i <= N; i++)
{
_sum += i;
}
cout << _sum;
}
signed main() {
setlocale(LC_ALL, "Rus");
int N;
cin >> N;
SumNumbers(N);
return 0;
}