题解列表

筛选

1196: 去掉空格

```cpp#include#includeusingnamespacestd;intmain(){stringstr,temp;while(getline(cin,str)){stringstreamss;sstemp)cout

1197: 发工资咯

```cpp#includeusingnamespacestd;intDno[6]={100,50,10,5,2,1};intsum(intx){inty=0,res=0;while(x>0){res+=x/Dno[y];x%=Dno[y++];}returnres;}intmain(){intn;w

2544: N以内累加求和(高斯)

##N以内累加求和(高斯)####还记得那个口号吗?######首项加末项乘以项数除以二,我记得我上小学奥数第一节课教的就是这个,好怀念:tw-1f31f:```c#includeintmain(){intn;scanf("%d",&n);printf("%d",

1198: 取石子游戏

```cpp#include#includeusingnamespacestd;intmain(){intx,y;doublealpha=(1.0+sqrt(5.0))/2.0,beta=(3.0+sqrt(5.0))/2.0;while(cin>>x>>y){if(x>y){x+=y;y=x-y;x

c语言————计算星期几

摘要:解题思路:竖式计算原理思路注意事项:参考代码:#include<stdio.h>int a[100001]={0};int main(){    int x,y,i,j,w=1;        a[0……

幂的末尾————希望对各位有所帮助

摘要:解题思路:竖式计算注意事项:参考代码:#include<stdio.h>int a[100001]={0}; //------定义一个大容量的全局变量整形数组,如果是定义成局部的话,会因为局部内存不足……

1084: 用筛法求之N内的素数

摘要:解题思路:素数慢慢判断注意事项:参考代码:#include<bits/stdc++.h> using namespace std; int main() {     int a;     c……

用数组的方法——简单且粗暴

摘要:解题思路:换个思路,输入的是一串字符。注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){    char a[10];    int i;……