C++. Циклы. Задача 1

Составить программу, которая выводит таблицу квадратов целых чисел от 1 до 10.

Решение:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include «stdafx.h»
#include <iostream>
#include <math.h>
using namespace std;
int main()
{setlocale(LC_ALL,«Rus»);
int n, chislo=1;
for (n=1; n<=10; n++)
{
cout<<chislo<<«\t«<<chislo*chislo<<endl;
chislo=chislo+1;
}
system(«pause»);
return 0;
}
Рейтинг
( 1 оценка, среднее 4 из 5 )
Загрузка ...