1.[CSP-J2019] 数字游戏
1.链接
传送门https://www.luogu.com.cn/problem/P5660
2.思路
本蒟蒻一看到这题,立马想到暴力求解:循环八遍,输入一个string,一位位判断是否为一,输出。
3.代码
#include<bits/stdc++.h>
using namespace std;
main(){
string a;
int b=0;
cin>>a;
for(int i=0;i<=7;i++){
if(a[i]=='1'){
b++;
}
}
cout<<b;
}
2.[CSP-J 2019] 公交换乘
1.链接
传送门https://www.luogu.com.cn/problem/P5661
2.思路
这是一道很有意境感的模拟题
我们需要算出小轩花费最少的钱,关键就在找出可以使用优