码迷,mamicode.com
首页 > 编程语言 > 详细

Problem I: 零起点学算法30——输出四位完全平方数

时间:2018-10-13 21:43:21      阅读:275      评论:0      收藏:0      [点我收藏+]

标签:main   pre   ret   nbsp   完全   bsp   输出   i++   include   

#include<stdio.h>
int main()
{
    int a,b,c,d,s,i;
    for(i=31;i<100;i++){
        s=i*i;
        a=s/1000;
        b=s%1000/100;
        c=s%100/10;
        d=s%10;
        if(a==b&&c==d)
        printf("%d\n",s); 
    }
    return 0; 
} 

 

Problem I: 零起点学算法30——输出四位完全平方数

标签:main   pre   ret   nbsp   完全   bsp   输出   i++   include   

原文地址:https://www.cnblogs.com/chenlong991223/p/9784091.html

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