题解列表

筛选

(c语言)超级简单用for方法!

摘要:解题思路:注意事项:每一次循环记得要恢复初始值参考代码:#include<stdio.h>int main(){ int n,m,b,c,d,e,sum=1,i,j,k; scanf("%d",&n)……

使用递归完成解题,代码清晰可读

摘要:解题思路:使用函数递归,返回两个数值,分别是空水瓶数和已购水瓶数,当空水瓶数=2时,返回值加1(如题所述),<2时,直接返回代码结构如下:注意事项:在编写代码途中,需要注意适当增加变量保存水瓶数,如变……

2791: 计算邮资

摘要:解题思路:注意事项:单字符用char,注意单个字符要用单引号括起来,字符串要用双引号。还要用ceil函数来解决大于1000克但小于一个500克的计数单位。参考代码:#include<bits/stdc……

超级简略版

摘要:解题思路:注意事项:参考代码:#include <stdio.h>int main() { int a=15,b=25,h,y=150; float m; h=y*2/a; m=(a+b)*h/2.0……

很简单的题

摘要:解题思路:无注意事项:无参考代码:#include<bits/stdc++.h>using namespace std;int M[20]= {0,31,0,31,30,31,30,31,31,30,……

1480 模拟计算器 初学者一定能懂

摘要:解题思路:用强制转换把ch转换成int类型注意事项:需要理解强制转换的定义,括号里面的是需要转换到的数据类型。e.g       #include <stdio.h>      int main() ……

1796: 蛇形填数

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<string>using namespace std;int n, a[150][150];void twins(i……