1086 will not tell you (15 points)

Homework time, sitting next Xiaopen friends ask you: "Five multiplied by seven equals how many?" You should be polite to enclose smiled and told him:. "Fifty-three" This question requires you, for any pair given positive integer, output their product backwards.

53.jpg

Input formats:

Given two input positive integer not more than 1000 A and B in the first row, separated by a space therebetween.

Output formats:

Backwards in row A and B outputs the product.

Sample input:

5 7

Sample output:

53
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
//	freopen("input.txt","r",stdin);
	int a,b;
	cin>>a>>b;
	string s;
	s = to_string(a*b); // int转字符串 
	reverse(s.begin(),s.end()); // 翻转string 
	a = atoi(s.c_str()); // 字符串转int 
	printf("%d",a);
	return 0;
}
//注意00001的时候要输出1 

 

Published 88 original articles · won praise 16 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_38603360/article/details/103706280