继续复习

来源:互联网 发布:常州青鸟软件 编辑:程序博客网 时间:2024/05/05 10:24

1620-7  唐大智《2016年12月23日》[连续第八十三天总结]

标题:继续复习

关键词:题目二个

内容(A)

写程序出结果:

#include<iostream.h>void main(void ){     char res[10]={0};     int i=0,x=3456,rem;     do{           rem=x%16;           x=x/16;           if(rem<10)res[i]='0'+rem;           else res[i]='A'+rem-10;           i++;        }while(x!=0);         i--;         for(;o>=0;i--)cout<<res[i];         cout<<endl;}
输出 D80.

(B)

#include<iostream.h>void main(){      int a[]={100,300,500},x=0;      int *p1=a+2,*p2=&x;      while(p1>=a){           *p2+=*p1;           p1--;           cout<<x<<endl;       }}
(C)明日计划:冲刺最后一天。


0 0
原创粉丝点击