Untitled
unknown
c_cpp
2 years ago
274 B
4
Indexable
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int qwe(int n)
{
if (n == 1)
{
return 1;
}
else
{
return n + qwe(n - 1);
}
}
int main()
{
int n;
cin >> n;
cout << qwe(n);
}Editor is loading...
Leave a Comment