设为首页 加入收藏

TOP

程序填空题(一)(三)
2019-06-08 10:07:56 】 浏览:437
Tags:程序 填空
sp;  {

           a=i/100;

           b=____________;                   //  (1)

           c=____________;                    //  (2)

           if (a==b || a==c || b==c)

                   ____________;               //  (3)

        cout<<i<<"  ";     

        cnt++; 

    }

    cout<<endl<<cnt<<endl;

    return 0;

}

 

9.将100元换成10元、5元和1元的组合,共有多少种组合方法

#include <iostream>

using namespace std;

int main()

{

       int i,j,k,count=0;         // i是10元张数,j是5元张数,k是1元张数

       for (i=0; ___________; i++)                // (1)

          for (j=0;  ___________ ; j++)          // (2)

         {

                    k= ___________ ;                // (3)

                    cout<<i<<'\t'<<j<<'\t'<<k<<endl;

                    count++;

        }

       cout<<count<<endl;

       return 0;

}

 

10.用1元人民币兑换成1分、2分、5分,共有多少种不同的兑换方法。

#include <iostream>

using namespace std;

int  main()

{  

     int five,two,count=0;

     for (five=0;five<=__________;five++)           //  (1)

       for (two=0; two<=__________;two++)       //  (2)

              count++;

     cout<< "共有 " << count << " 种兑换方法" <<endl;

     return 0;

}

 

11.从键盘输入一个非负整数,将它反向显示出来。例如,输入1234,输出4321。

#include <iostream>

using namespace std;

int  main() 

{

int number,digit;

cin>>number;

cout<< number <<" 的逆序数为 ";

do  {

     digit=_________________________;             // (1)

     number=________________________;       // (2)

     cout<<digit;

} while (______________________);                // (3)

cout<<endl;

       return 0;

}

&n

首页 上一页 1 2 3 4 5 6 7 下一页 尾页 3/10/10
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇魔方阵的构造 下一篇题解 P1162 【填涂颜色】

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目