The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemA:Accurately Say "CocaCola"!
来源:互联网 发布:淘宝上的睡衣模特 编辑:程序博客网 时间:2024/06/06 02:25
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2965
题意:一群人玩过“7”的游戏,有7的数字或者7的倍数就要喊“cocacola”。给出一个数字p,求连续要喊“cocacola”p次的最小数字s;
思路:刚开始想着,2是27,3-10都是70,11-100都是700。。。后来一直WA,打个表才知道,270-280有11个。。。。所以….`
#include<bits/stdc++.h>using namespace std;int main() { int t,p,s; cin>>t; while(t--) { cin>>p; if(p==1) s=7; else if(p==2) s=27; else if(p>2&&p<=10) s=70; else if(p==11) s=270; else if(p>11&&p<=100) s=700; cout<<s<<endl; } return 0;}
0 0
- The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemA:Accurately Say "CocaCola"!
- The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemA:Accurately Say "CocaCola"!
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemA:Second-price Auction
- The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemA:Second-price Auction
- The 5th Zhejiang Provincial Collegiate Programming Contest 部分题解
- The 5th Zhejiang Provincial Collegiate Programming Contest
- The 7th Zhejiang Provincial Collegiate Programming Contest
- The 6th Zhejiang Provincial Collegiate Programming Contest
- The 8th Zhejiang Provincial Collegiate Programming Contest / L - Javabeans
- The 8th Zhejiang Provincial Collegiate Programming Contest / M - Median
- The 8th Zhejiang Provincial Collegiate Programming Contest
- The 9th Zhejiang Provincial Collegiate Programming Contest
- The 10th Zhejiang Provincial Collegiate Programming Contest Solution
- The 11th Zhejiang Provincial Collegiate Programming Contest---Talented Chef
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- The 11th Zhejiang Provincial Collegiate Programming Contest
- JavaScript arguments 对象
- 【千里之行,始于足下】游戏服务端开发--前言
- 树莓派FM广播点歌系统
- 《python基础教程》第一章 基础知识
- HDU——2723Electronic Document Security(STL map嵌套set做法)
- The 5th Zhejiang Provincial Collegiate Programming Contest------ProblemA:Accurately Say "CocaCola"!
- Spring Boot Junit单元测试
- for循环绑定监听事件索引值总是最后一个
- Toradex 发布基于ARM系统模块的Windows 10 IoT Core 技术预览版
- poj 2411 骨牌覆盖问题 状压dp
- java基础(函数)
- ubuntu卡在stopping restore sound card state
- Linux精讲——chmod命令
- The 5th Zhejiang Provincial Collegiate Programming Contest---ProblemE:Easy Task