nyoj 96 一个水题目

虽然很简单,发现自己用内存太高了了,算了,我就是这水平了。

描述

已知w是一个大于10但不大于1000000的无符号整数,若w是n(n≥2)位的整数,则求出w的后n-1位的数。

输入
第一行为M,表示测试数据组数。
接下来M行,每行包含一个测试数据。
输出
输出M行,每行为对应行的n-1位数(忽略前缀0)。如果除了最高位外,其余位都为0,则输出0。
样例输入
4
1023
5923
923
1000
样例输出 23
923
23
0
#include<iostream>
using namespace std;
int main()
{
int len;
cin>>len;
while(len--)
{
char c[1000000];
cin>>c;
char *s=c+1;
while(*s!='\0'&&*s=='0')
{
s=s+1;
}
if(*s=='\0')
{
cout<<0<<endl;
} else
{
cout<<s;
} } return 0;
}
上一篇:java.lang.ClassCastException: android.widget.TextView cannot be cast to android.widget.EditText


下一篇:ExtJs 4: How To Add Grid Cell Tooltip