题解列表
1049: [编程入门]结构体之时间设计
摘要:解题思路:注意事项:参考代码:#include <stdio.h>typedef struct date{ int year,month,day;}D;int main(){ D d; int tot……
Hello World!
摘要:#include <stdio.h>void main(){ printf("**************************\n"); printf("Hello World!\n"……
1048: [编程入门]自定义函数之字符串拷贝
摘要:解题思路:注意事项:参考代码:#include <stdio.h>#define LEN 100int main(){ char str[LEN]={'\0'},result[LEN]……
定义数组时下标为变量导致错误
摘要:注意事项:定义数组时下标不能为未知的变量:第一遍写的代码将a[n][n]定义在对n取值之前,答案出现问题。因为在定义数组时下标不能为未知的变量,因为在本题中是在全局定义中定义了数组,而编译器在编译时会……
1046: [编程入门]自定义函数之数字后移
摘要:解题思路:注意事项:参考代码:#include <stdio.h>#define LEN 100 //最大长度 int main(){ int arr[LEN]; int m,n; //输入长度、……
1045: [编程入门]自定义函数之整数处理
摘要:解题思路:注意事项:依次选出和交换max、min,别先选出各自下标,再交换,在第一次交换时,可能会改变原下标下的数值,先前记录的max/min已被更新,造成标记过时参考代码:#include <std……
编写题解 1043: [编程入门]三个数字的排序
摘要:解题思路:暴力法注意事项:参考代码:#include <stdio.h>#define CHANGE(a,b) t=a,a=b,b=tint main(){ int a,b,c,t; scanf("%……
【C语言】简单求s=a+aa+aaa+aaaa+aa...a的值
摘要:#include <stdio.h>
int main()
{
int a,n,sum;
long long s=0;
int i;
scanf("%d%d",&a,&n);
……