题太水 答案供参考
#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); }
题目 3285 [CSP 2019J]数字游戏
2024-07-21 10:40:26
|
|
#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; }
题目 3049 [NOIP 2018PJ]标题统计
2024-07-21 10:20:47
|
|
so easy
|
|
这道题太水,别写了
#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
|
|
Just so so~
|
|
题目 2562 [NOIP 2016PJ]买铅笔
2024-07-21 09:09:26
|
|
#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]; }
题目 2562 [NOIP 2016PJ]买铅笔
2024-07-21 09:06:31
|
|
so easy
|
|
#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
|
|
简单
|
|
#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;}
题目 1268 [NOIP 2012PJ]质因数分解
2024-07-20 10:25:47
|
|
诶亚,这怎么回事儿啊这是
题目 623 [NOIP 2011]数字反转
2024-07-20 09:16:29
|
|
不嘻嘻
|
|
12345678900987654321234
题目 623 [NOIP 2011]数字反转
2024-07-20 08:44:13
|
|
#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);} |
|
多谢前辈
题目 2020 [NOI 2015]寿司晚宴
2024-07-19 15:49:28
|
|
#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);}
题目 1423 [NOIP 2013]计数问题
2024-07-19 10:53:52
|
|
回复 @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;} 。。。。。。。。。
题目 623 [NOIP 2011]数字反转
2024-07-19 10:12:03
|
|
题目 1053 [NOIP 2009PJ]多项式输出
2024-07-18 09:00:06
|
|
so easy
题目 1053 [NOIP 2009PJ]多项式输出
2024-07-18 08:58:38
|