1 0 0
2 1 1
3 3 2
4 6 3
5 10 4
6 15 5
7 21 6
Код на c++:
#include <iostream>
using namespace std;
int main()
{
int S = 0;
for(int i = 0; i<=6; ++i) {
S=S+i;
cout<<i+1<<" "<<S<<" "<<i;
cout<<endl;
}
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
1 0 0
2 1 1
3 3 2
4 6 3
5 10 4
6 15 5
7 21 6
Код на c++:
#include <iostream>
using namespace std;
int main()
{
int S = 0;
for(int i = 0; i<=6; ++i) {
S=S+i;
cout<<i+1<<" "<<S<<" "<<i;
cout<<endl;
}
return 0;
}