Gravatar
haoshuai
积分:16
提交:12 / 35
题太水 答案供参考
#include <bits/stdc++.h>
using namespace std;
int main()
{
string s;
int i,n,st,s1=0;
freopen("csp2019pj_number.in","r",stdin);
freopen("csp2019pj_number.out","w",stdout);
getline(cin,s);
st=s.length();
for(i=0;i<=st-1;i++)
if(s[i]=='1') s1++;
if(s1==0) cout<<'0';
else cout<<s1;
fclose(stdin);
fclose(stdout);
}

Gravatar
回归运动
积分:59
提交:47 / 125
#include<bits/stdc++.h>
using namespace std;
int main()
{freopen("title.in","r",stdin);
freopen("title.out","w",stdout);
char st[200];int sum;
while(scanf("%s",st)==1) sum+=strlen(st);
cout<<sum;
}

Gravatar
father
积分:79
提交:35 / 85
so easy

Gravatar
haoshuai
积分:16
提交:12 / 35
这道题太水,别写了
#include <bits/stdc++.h>
using namespace std;
int main()
{
int A,B,C,s=0;
freopen("nscore.in","r",stdin);
freopen("nscore.out","w",stdout);
cin>>A>>B>>C;
s=A*0.2+B*0.3+C*0.5;
cout<<s;
fclose(stdin);
fclose(stdout);
return 0;
}

题目 2868 [NOIP 2017PJ]成绩
2024-07-21 09:21:08
Gravatar
music
积分:30
提交:24 / 34
Just so so~

Gravatar
haoshuai
积分:16
提交:12 / 35
回复 @回归运动 :
666

Gravatar
回归运动
积分:59
提交:47 / 125
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("pencil.in","r",stdin);
freopen("pencil.out","w",stdout);
int n,num[5]={},pri[5]={},alm[5];
cin>>n;
for(int i=1;i<=3;i++)
{cin>>num[i]>>pri[i];
if(n%num[i]==0) alm[i]=n/num[i]*pri[i];
if(n%num[i]!=0) alm[i]=(n/num[i]+1)*pri[i];}
for(int i=1;i<=2;++i)
for(int j=1;j<=3-i;++j)
if(alm[j]<alm[j+1])
swap(alm[j],alm[j+1]);
cout<<alm[3];
}

Gravatar
father
积分:79
提交:35 / 85
so easy

Gravatar
回归运动
积分:59
提交:47 / 125
#include <bits/stdc++.h>
using namespace std;
int main()
{
freopen("2015coin.in","r",stdin);
freopen("2015coin.out","w",stdout);
int n,jinbi=0,days=0;
cin>>n;
for(int i = 1;i<=n;i++)
{if(days>=n) break;
for(int j = 1;j<i+1;j++)
{jinbi+=i;
days++;
if(days>n) jinbi-= i;}}
cout<<jinbi;}

题目 2110 [NOIP 2015PJ]金币
2024-07-21 08:20:09
Gravatar
九祁
积分:11
提交:8 / 58
简单

Gravatar
回归运动
积分:59
提交:47 / 125
#include<bits/stdc++.h>
using namespace std;
int main(){
long long a,j=0;
freopen("prime.in","r",stdin);
freopen("prime.out","w",stdout);
cin>>a;
for(long long int i=2;i<sqrt(a);i++)
{if(a%i==0) {cout<<a/i; break;fclose(stdin);fclose(stdout);}}return 0;}

Gravatar
haoshuai
积分:16
提交:12 / 35
诶亚,这怎么回事儿啊这是

Gravatar
music
积分:30
提交:24 / 34
不嘻嘻

Gravatar
haoshuai
积分:16
提交:12 / 35
12345678900987654321234

Gravatar
回归运动
积分:59
提交:47 / 125
#include<bits/stdc++.h>
using namespace std;
int main()
{freopen("twoj.in","r",stdin );
freopen("twoj.out","w",stdout );
int l,r,j,x=0,k=0;
cin>>l>>r;
for(int i=l;i<=r;++i)
{j=i;while(j)
{
k=j%10;
if(k==2) x++;
j=j/10 ;}}
cout<<x;
return 0;
fclose(stdin);fclose(stdout);}

Gravatar
qyd
积分:693
提交:222 / 741
多谢前辈

Gravatar
回归运动
积分:59
提交:47 / 125
#include<bits/stdc++.h>
using namespace std;
int main()
{freopen("count2013.in","r",stdin );
freopen("count2013.out","w",stdout );
int n,z,j,x=0,k=0;
cin>>n>>z;
for(int i=1;i<=n;++i)
{j=i;while(j)
{
k=j%10;
if(k==z) x++;
j=j/10 ;}}
cout<<x;
return 0;
fclose(stdin);fclose(stdout);}

Gravatar
回归运动
积分:59
提交:47 / 125
回复 @2018noip必胜! :
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b=0;
freopen("reverse.in","r",stdin);
freopen("reverse.out","w",stdout);
cin>>a;
while (a)
{b=b*10+a%10;
a/=10;}
cout <<b;}
。。。。。。。。。

Gravatar
music
积分:30
提交:24 / 34
回复 @father :
just so so

Gravatar
father
积分:79
提交:35 / 85
so easy