题解列表

筛选

累加求和 for循环

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){   int a,sum=0,y;    scanf("%d",&a); for (y=1;y<=a;y++)  ……

自定义函数处理最大公约数与最小公倍数

摘要:解题思路:我没有用辗转相除,先计算两个数有相同的公因式的,那么最小公倍数就是你输入的较大的数,然后判断是不是两个奇数,那么最小公倍数就是两数之积(9,3这类的 数字已经被排除出去了),最后就是一个奇数……

排序条件运算

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){int a,b,c,max,min,m;scanf("%d%d%d",&a,&b,&c);max=a>b?a:b;……

春夏秋冬季节判断

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a; scanf("%d",&a);    switch (a){    case 1:    ca……

边长判断有手就行

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int a,b,c,max,min,m; scanf("%d%d%d",&a,&b,&c); max=a>b?a……

考试评级 Switch 语句

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int x,y; scanf("%d",&x); y=x/10;  switch (y){ case 10: ……

分段计算题解

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int x,y; scanf("%d",&x);  if(x<3) y=2*x; else if(x<20) y……

母牛问题解决代码

摘要:解题思路:注意事项:参考代码:#include<iostream>    using namespace std;typedef long long ll;ll a[100005];int main(……