上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页
摘要: 题目:编写input()和output()函数输入,输出5个学生的数据记录。 程序分析:无。 程序源代码: 1 #include<stdio.h> 2 #include<stdlib.h> 3 typedef struct{ 4 char name[20]; 5 char sex[5]; 6 int 阅读全文
posted @ 2020-07-11 16:55 C语言自学网 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 头文件添加方法:工程 属性 配置属性 c/c++ 常规 附加包含目录(Additional Include Directories):加上头文件存放目录。注意:(1)路径必须指向头文件所在的子文件夹,而不能直到父文件夹就结束(2)每个路径不需要加上双引号,输入了之后,vs会自动加上双引号,如果自己加 阅读全文
posted @ 2020-07-11 15:49 C语言自学网 阅读(1234) 评论(0) 推荐(2) 编辑
摘要: 题目:写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度。 程序分析:无。 实例: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int len; 6 char str[20]; 7 printf(" 阅读全文
posted @ 2020-07-11 15:26 C语言自学网 阅读(285) 评论(0) 推荐(0) 编辑
摘要: 题目:有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。 程序分析:无。 实例: 1 #include <stdio.h> 2 void main() 3 { 4 int num[50],n,*p,j,loop,i,m,k; 5 p 阅读全文
posted @ 2020-07-11 15:19 C语言自学网 阅读(234) 评论(0) 推荐(0) 编辑
摘要: 题目:有 n个整数,使其前面各数顺序向后移 m 个位置,最后m个数变成最前面的 m 个数。 程序分析:无。 实例: 1 #include <stdio.h> 2 #include <stdlib.h> 3 int main() 4 { 5 int arr[20]; 6 int i,n,offset; 阅读全文
posted @ 2020-07-11 15:00 C语言自学网 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 题目:输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组。 程序分析:谭浩强的书中答案有问题。 实例: 1 #include<stdio.h> 2 #include<stdlib.h> 3 4 void fun(int *s,int n) 5 { 6 int i; 7 int ma 阅读全文
posted @ 2020-07-11 14:42 C语言自学网 阅读(289) 评论(0) 推荐(0) 编辑
摘要: 题目:输入3个数a,b,c,按大小顺序输出。 程序分析:利用指针方法。 实例: 1 # include<stdio.h> 2 3 void swap(int *, int *); 4 int main(void) 5 { 6 int a, b, c; 7 int *p1, *p2, *p3; 8 p 阅读全文
posted @ 2020-07-11 14:41 C语言自学网 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 题目:一个最优美的图案(在TC中实现)。 程序分析:无。 程序源代码: 1 #include "graphics.h" 2 #include "math.h" 3 #include "dos.h" 4 #include "conio.h" 5 #include "stdlib.h" 6 #inclu 阅读全文
posted @ 2020-07-11 14:39 C语言自学网 阅读(226) 评论(0) 推荐(0) 编辑
摘要: 题目:利用ellipse and rectangle 画图(在TC中实现)。 程序分析:无。 程序源代码: 1 #include "stdio.h" 2 #include "graphics.h" 3 #include "conio.h" 4 main() 5 { 6 int driver=VGA, 阅读全文
posted @ 2020-07-11 14:38 C语言自学网 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 题目:画椭圆ellipse(在TC中实现)。 程序分析:无。 程序源代码: 1 #include "stdio.h" 2 #include "graphics.h" 3 #include "conio.h" 4 int main() 5 { 6 int x=360,y=160,driver=VGA, 阅读全文
posted @ 2020-07-04 17:23 C语言自学网 阅读(237) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 12 下一页