JLU2119LWC @ 2020-01-28 16:08:17
求JAVA大佬
样例正确,几个易错数据正确,下载测试点数据正确。
提交测试RE
我TM哭泣
import java.util.Scanner;
public class Main {
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int ans = 0;
while(n != 0)
{
ans = ans * 10 + n % 10;
n/= 10;
}
System.out.print(ans);
}
}
by UnyieldingTrilobite @ 2020-01-28 16:18:12
JAVA菜鸡我一直以为那个函数叫System.out.println
by UnyieldingTrilobite @ 2020-01-28 16:22:51
话说您的代码同义转化为c++就AC了
#include <iostream>
using namespace std;
int main(){
int n;cin>>n;
int ans = 0;
while(n != 0)
{
ans = ans * 10 + n % 10;
n/= 10;
}
cout<<ans<<endl;
return 0;
}