road_under_rain @ 2023-11-05 23:08:34
#include<stdio.h>
#include<math.h>
int main (void)
{
char a[30];
long long m,i,k,b=0;
scanf("%ld %ld",&m,&k);
for( i =1; i<=15;i++)
{a[i-1]=m%(int)pow(10,i)/(int)pow(10,i-1);
int c=a[i-1];
if(c/3==1)
b++;}
for( i =1; i<=15;i++)
{
printf("%d\n",a[i-1]);
}
return 0;
}/为什么我这个判断有问题?还有为什么输入到十位数以上就会读取错误?求求各位大佬救一下。/
by _sunkuangzheng_ @ 2023-11-05 23:41:21
@road_under_rain
by Programmer_Wang @ 2023-11-06 00:00:30
prw前的int都换成long long int不够大,位数过大会溢出