По разделам

 

Решение задачи Integer 10


Дано трехзначное число. Вывести вначале его последнюю цифру
(единицы), а затем — его среднюю цифру (десятки).

Код (C/C++)

#include <iostream>
using namespace std;
int main(){
	int n;
	cout << "Vvedite chislo N: ";
	cin >> n;
	cout << "Edinitsi: " << n%10 << endl;
	cout << "Desyatki: " << int(n/10)%10;
	return 0;
}

Код (Python)

import random

N = random.randrange(100,1000)
print("Число: ", N)
d1 = int((N-d2*100)/10)
d0 = N%10
print("Единицы: ", d0)
print("Десятки: ", d1)
									

Код (Pascal)

program Integer10;
var
  A, Res: Integer;
begin
  Write('Введите трёхзначное число: ');
  Readln(A);
  Res:=(A mod 10)*10 + (A mod 100) div 10; //*
  Writeln('Первая цифра данного числа является: ',Res);
end.
									

Дополнительно

a  = int(input())
print(a % 10)
print(a % 100 // 10)
									



Integer. Абрамян
Integer 1 Просмотров: 11700
Integer 2 Просмотров: 7427
Integer 3 Просмотров: 7807
Integer 4 Просмотров: 35918
Integer 5 Просмотров: 8335
Integer 6 Просмотров: 6838
Integer 7 Просмотров: 6666
Integer 8 Просмотров: 5367
Integer 9 Просмотров: 4476
Integer 10 Просмотров: 6104
Integer 11 Просмотров: 6413
Integer 12 Просмотров: 6865
Integer 13 Просмотров: 6405
Integer 14 Просмотров: 3409
Integer 15 Просмотров: 4330
Integer 16 Просмотров: 3540
Integer 17 Просмотров: 3816
Integer 18 Просмотров: 3488
Integer 19 Просмотров: 5319
Integer 20 Просмотров: 4051
Integer 21 Просмотров: 4394
Integer 22 Просмотров: 3588
Integer 23 Просмотров: 4451
Integer 24 Просмотров: 8302
Integer 25 Просмотров: 3530
Integer 26 Просмотров: 3173
Integer 27 Просмотров: 2927
Integer 28 Просмотров: 3644
Integer 29 Просмотров: 4993
Integer 30 Просмотров: 4551

Комментарии

Чтобы написать комментарии вам нужно войти в систему или зарегистрироваться



Заявка на расчет