题解列表

筛选

纸张尺寸C++

摘要:```cpp #include using namespace std; int main() { string s; cin>>s; int sz=s[1]-'0'……

用了C++中的vector数组

摘要:解题思路:注意事项:参考代码:#include<iostream>#include<vector>using namespace std;vector<int> arr;bool method1(in……

lf-Hello,world! 普通解法

摘要:解题思路:注意事项:参考代码:    #include    int main(){      int a;      char s;      while(scanf("%d",&a)!=EOF){……

暴力法求解

摘要:解题思路:注意事项:参考代码:    #include<stdio.h>    int function(int x){     int i;      for(i=2;i<x;i++){     ……

C语言简单暴力实现,注意要特判x=1的情况

摘要:解题思路:从2开始进行遍历,如果能被整除就说明不是素数,注意循环条件不能<=x,只能<x注意事项:在c语言里面是没有bool 类型的,如果在函数里面直接返回bool类型会报错,建议返回数字类型,或者用……

思路简单一些吧

摘要:解题思路:大家都用*3-1,还用while,我用的好少,总是用for循环有时候也要换个方法方向注意事项:我没有看出来i*3-1的规律,只知道在前一个数基础上加三。我的程序好理解吗参考代码:n=int(……

1013: [编程入门]Sn的公式求和

摘要:解题思路:这道题可以用循环去模拟它的过程,算出答案。注意事项:注意每个位上的数字为2.参考代码:#include<bits/stdc++.h>using namespace std;long long……