int b = 0, c = 0;// b 输入的0~255之间的数 c 移动位数
printf("请输入一个整数和移动位数\n");
scanf("%d%d", &b, &c);
unsigned char a = b;
unsigned char left = 0;//存储左移之后的结果
unsigned char right = 0;...
分类:
编程语言 时间:
2014-08-15 09:33:07
阅读次数:
255
int a[20] = {0};
为数组中的元素赋值
for (int i = 0; i
a[i] = arc4random() % (50 - 10 + 1) + 10;
printf("%d", a[i]);
printf("\n");
}
int max = a[0], sex = a[0];
...
分类:
其他好文 时间:
2014-08-15 09:32:47
阅读次数:
172
//调用
//char*ptr=(char*)malloc(sizeof(char)*128);
//ptr=get_passwd();
//printf("\n");#include<stdio.h>#include<termios.h>#include<unistd.h>#include<assert.h>#include<string.h>#include<stdlib.h>intgetch(){ intc=0; structt..
分类:
系统相关 时间:
2014-08-15 02:42:17
阅读次数:
300
#include void main(){ int year,month,day,sum,m; printf("请输入年月日(如:1991,1,1)\n"); scanf("%d,%d,%d",&year,&month,&day); if((month==2&&day==30)||(month==2...
分类:
其他好文 时间:
2014-08-14 23:49:26
阅读次数:
243
#include void main(){ int a,b,c,t; printf("请输入三个整数:\n"); scanf("%d,%d,%d",&a,&b,&c); if(a<b) { t=a; a=b; b=t; } if(a<c) { t=a; a=c; ...
分类:
其他好文 时间:
2014-08-14 23:14:04
阅读次数:
217
#include void main(){ /*方法一 int score; printf("请输入分数:\n") ; scanf("%d",&score); if (score>=90&&score=80) { printf("等级为B\n") ; } else if (sco...
分类:
其他好文 时间:
2014-08-14 23:09:46
阅读次数:
137
#include void main(){ int weekday; printf("请输入星期几:\n"); scanf("%d",&weekday); switch(weekday) { case 1: printf("星期一\n"); break; case 2: printf("...
分类:
其他好文 时间:
2014-08-14 23:07:16
阅读次数:
231
#include void main(){ int year,month,day,daynum; printf("请输入年月日,用,号隔开,格式列(2014,5,12)\n"); scanf("%d,%d,%d",&year,&month,&day); switch(month) { case...
分类:
其他好文 时间:
2014-08-14 23:06:48
阅读次数:
276
#include #define PI 3.14 void main(){ int num; printf("请选择您要执行的操作:1.计算圆形面积2.长方形面积3.三角形面积\n"); scanf("%d",&num); switch (num) { c...
分类:
其他好文 时间:
2014-08-14 23:05:36
阅读次数:
198
#include void main(){ int age; printf("请输入年龄:\n"); scanf("%d",&age); switch(age) { case 2: case 3: printf("孩子进入小班\n"); break; case 4: printf...
分类:
其他好文 时间:
2014-08-14 23:05:06
阅读次数:
175