第四天编程练习

 1 #include<stdio.h>
 2 
 3 int main()
 4 
 5 {
 6     //short a = 0xfffe;
 7     //printf("%d\n",a);
 8 
 9     //unsigned short a = 0xfffe;
10     //printf("%u\n",a);
11 
12     //short a = 0x7fff + 2;
13     //printf("%d\n",a);
14 
15     unsigned short a = 0xffff + 5;
16     printf("%u\n",a);
17     return 0;
18 }
1 #include<stdio.h>
2 int main()
3 {
4 
5     unsigned short a = 0xffff + 5;
6     printf("%u\n",a); 
7 
8 return 0;
9 }
1 #include<stdio.h>
2 int main()
3 {
4     int a; 
5     scanf("%d",&a);
6     printf("%d\n",a);
7 
8     return 0;
9 }
1 #include<stdio.h>
2 
3 int main()
4 
5 {
6     printf("huangping nihao \n");
7 
8     return 0;
9 }
 1 #include<stdio.h>
 2 
 3 int main()
 4 {
 5 
 6     int n =10; 
 7     while (n++)
 8     printf("n=%d\n",n);
 9     return 0;
10 }
 1 #include<stdio.h>
 2 
 3 int main()
 4 {
 5 
 6     int i = 10000000;
 7     while (i--)
 8 {
 9     printf("%d\n",i);
10 }    
11     printf("循环结束\n");
12     printf("此时i=%d\n",i);
13 
14 return 0;
15 }
 1 #include<stdio.h>
 2 
 3 int main()
 4 {
 5     char ch;
 6     printf("请输入ch的值");
 7     scanf("%c",&ch);
 8     printf("ch=%c\n",ch);
 9     return 0;
10 }
 1 #include<stdio.h>
 2 
 3 int main()
 4 {
 5     printf("abc");
 6     printf("\refg\n");//\切换到句首, \n为换行键
 7 
 8     printf("abc");
 9     printf("\befg\n");//\b为退格键,\n为换行键
10 
11     printf("%d\n",'\123');//'123'为8进制转义字符,0123对应10进制数为83
12     printf("%d\n",'\x23');//‘\x23’为16进制转义字符,0x23对应10进制数为35        
13 
14     return 0;
15 }

 

转载于:https://www.cnblogs.com/xiaojiu14/p/10669438.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值