题解列表

筛选

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

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

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

数组+循环

摘要:解题思路:注意事项:参考代码:#include<stdio.h>int main(){ int n; double x,y[100],j,k; scanf("%d",&n); scanf("%lf %……

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

1196: 去掉空格

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

统计数字字符个数

摘要:、解题思路:注意事项:参考代码:#include<stdio.h>#include<string.h>int main(){      int i,n=0;      char a[255];    ……