PAT乙级 1086 就不告诉你 (15分)
这题和PAT乙级 1091 N-自守数 (15分)的考点是一毛一样的,主要考察函数的使用,函数会用,几行代码就能搞定,函数不会用,就需要自己写函数,会浪费很多时间。
本人代码如下,应该和网上很多会重复,毕竟思路一样,另外本题坑点为
个测试点,网上也有就是100*100 的reverse应该输出1而不是00001,所以用stoi函数输出(哈哈哈,这个我也是参考别人的,抄的)!
#include <iostream>
#include <algorithm>
#include<cmath>
#include <stdlib.h>
#include <string.h>
using namespace std;
int main(){
int a,b;
scanf("%d %d",&a,&b);
int c=a*b;
string temp;
temp = to_string(c);
reverse(temp.begin(),temp.end());
cout<<stoi(temp)<<endl;
}