Var sum,i:integer;
begin
sum:=0;
for i:=100 to 999 do
if (i mod 3=0) then sum:=sum+i;
writeln('Сумма трехзначных чисел кратных трем равна ',sum);
<span>end.</span>
#include <iostream>
#include <cmath>
using namespace std;
void isArmstrong(const int number)
{
int origNum, num, rem, sum = 0;
origNum = number;
num = origNum;
while(num != 0) {
rem = num % 10;
sum += pow(rem, 3);
num /= 10;
}
if(sum == origNum)
cout << origNum << " is an Armstrong number.";
else
cout << origNum << " is not an Armstrong number.";
}
int main()
{
isArmstrong(153);
return 0;
}
_________________________
С проверкой https://ideone.com/keY6PS
Измениение- перемена параметров