View Code of Problem 77

#include<stdio.h>
#include<math.h>
int qiuweishu(int n){
    int i=0;
    while (n!=0){
        n=n/10;
        i++;
    }
    return i;
}
int main(){
    int k;
    scanf("%d",&k);
    int s=qiuweishu(k);
    for (int i = 0; i <3 ; i++) {
        int ss=pow(10,s-1);
        printf("%d ",k/ss);
        k=k%ss;
        s=s-1;
    }
    printf("%d",k%10);

    return 0;
}

Double click to view unformatted code.


Back to problem 77