打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
086.爱因斯坦的数学题
#include<stdio.h>
void main()
{
    int i=1;                  /*i为所设的阶梯数*/
    clrscr();
    puts("**************************************************");
    puts("*        This program is to solve                *");
    puts("*     Einstein's interesting math question,      *");
    puts("*   which is presented by Albert Einstein,       *");
    puts("*       a famous theoretical physicist.          *");
    puts("* The Problem is as follows: there is a long     *");
    puts("* ladder, if one step strides 2 stages, 1 stages *");
    puts("* left, if one step strides 3 stages, 2 stages   *");
    puts("* left, if one step strides 5 stages, 4 stages   *");
    puts("* left, if one step strides 7 stages, 0 stages   *");
    puts("* left, the question is, how many stages has     *");
    puts("* the ladder?                                    *");
    puts("**************************************************");
    while(!((i%2==1)&&(i%3==2)&&(i%5==4)&&(i%6==5)&&(i%7==0)))
        ++i;                  /*满足一组同余式的判别*/
    printf("\n >> The ladder has %d stages.\n",i);
    puts("\n Press any key to quit...");
    getch();
}
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
【一日一结】绳梯(Rope Ladder)
【每日一句】The world puts off its mask of vastness to i...
Left Right Left
高考英语七选五怎么做?这么做,肯定不出错!
每日原则:认识到你不能“只产出不吸纳”
缤纷英语口语50句
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服