码迷,mamicode.com
首页 > 其他好文 > 详细

13.任意次方后的后三位

时间:2018-01-18 20:43:46      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:class   input   padding   rgb   clu   return   main   ret   ++   

#include <stdio.h>

int main(int argc, char *argv[])
{
    int x,y,a = 1; 
    printf("input x y(x^y):");
    scanf("%d %d",&x,&y);
    int i;
    for(i = 1;i<=y;i++)
    {
        a=a*x; 
    }
    printf("%d\n",a);

    int x1,x2,x3;
    x1 = a-(a/10)*10;
    x2 = (a-(a/100)*100)/10;
    x3 = (a-(a/1000)*1000)/100;
    printf("result:%d %d %d\n",x3,x2,x1);
    return 0;
}

13.任意次方后的后三位

标签:class   input   padding   rgb   clu   return   main   ret   ++   

原文地址:https://www.cnblogs.com/Aidongshu/p/8312658.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!