По разделам

 

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


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

Код (C/C++)

#include <iostream>
using namespace std;
int main(){
	int n, f, s, n_new;
	cout << "Vvedite chislo N: ";
	cin >> n;
	f = int(n/10);
	s = n%10;
	n_new = s*10+f;
	cout << "Chislo, poluchennoe v rezul'tate perestanovki cifr iskhodnogo chisla: " << n_new;
	return 0;
}

Код (Python)

import random

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

Код (Pascal)

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




Integer. Абрамян
Integer 1 Просмотров: 11855
Integer 2 Просмотров: 7526
Integer 3 Просмотров: 7954
Integer 4 Просмотров: 35999
Integer 5 Просмотров: 8404
Integer 6 Просмотров: 6935
Integer 7 Просмотров: 6779
Integer 8 Просмотров: 5427
Integer 9 Просмотров: 4547
Integer 10 Просмотров: 6163
Integer 11 Просмотров: 6506
Integer 12 Просмотров: 6925
Integer 13 Просмотров: 6463
Integer 14 Просмотров: 3463
Integer 15 Просмотров: 4389
Integer 16 Просмотров: 3585
Integer 17 Просмотров: 3878
Integer 18 Просмотров: 3536
Integer 19 Просмотров: 5377
Integer 20 Просмотров: 4118
Integer 21 Просмотров: 4465
Integer 22 Просмотров: 3628
Integer 23 Просмотров: 4510
Integer 24 Просмотров: 8377
Integer 25 Просмотров: 3639
Integer 26 Просмотров: 3219
Integer 27 Просмотров: 2980
Integer 28 Просмотров: 3729
Integer 29 Просмотров: 5067
Integer 30 Просмотров: 4628

Комментарии

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



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