2016年1月23日

C语言 百炼成钢12

摘要: //题目34:对10个数进行排序 #include #include //分析:使用冒泡排序 void main(){ int arr[10] = { 9, 2, 4, 7, 5, 71, 45, 46, 7, 8 }; //定义临时变量 int temp = 0; //冒泡排序 双循环 for (int i = 0; i arr[j]) ... 阅读全文

posted @ 2016-01-23 16:57 寒魔影 阅读(322) 评论(0) 推荐(0) 编辑

C语言 生成随机数

摘要: #include #include #include void main1(){ //定义一个时间类型 time_t ts;//头文件time.h //生成随机数种子 srand((unsigned int)(time(&ts))); int num = 0; while (1){ Sleep(1000); //r... 阅读全文

posted @ 2016-01-23 15:48 寒魔影 阅读(294) 评论(0) 推荐(0) 编辑

C语言 百炼成钢11

摘要: //题目31:请输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续 //判断第二个字母。 #define _CRT_SECURE_NO_WARNINGS #include #include #include //分析:通过输入的字母判定星期几,可以使用if()else void main(){ char str[7] = { 0 }; scanf("%s"... 阅读全文

posted @ 2016-01-23 00:09 寒魔影 阅读(248) 评论(0) 推荐(0) 编辑

导航