UC Browser
来源:互联网 发布:jre 6 windows.exe 编辑:程序博客网 时间:2024/04/27 19:30
Brother Xi has recently bought a smart mobile phone. Now he surfs Internet by his mobile phone almost every day. The browser that he uses is UC Browser, which is one of the most popular mobile browsers. To better grasp the users, UC Corporation have also brought out the level system of user account. The higher the level of your account, the more privileges you can enjoy. The level of your account is calculated by your experiences. The correspondence of level and experience is as follows:
Level
Experiences
Level
Experiences
Level
Experiences
0
0-49
3
250-349
6
550-649
1
50-149
4
350-449
7
650-749
2
150-249
5
450-549
8
>=750
Input
The first line of the input contains a single integer T (0<T<120) which is the number of test cases, followed by 2*T lines. For each test case, the first line is the number of days n (0<n<=100), the second line is a series of 0 and 1. 0 stands for not using UC browser on that day and 1 stands for using UC browser on that day.
Output
For each test case, output the corresponding level of Xi’s account in one line.
Sample Input
2611010112111111110101
Sample Output
12
代码:
#include <cstdio>#include <math.h>#include <algorithm>#include <cstring>#include <string>#include <iostream>using namespace std;int main(){int n;scanf_s("%d", &n);while (n--){int d, grade = 0;scanf_s("%d", &d);int i,k=0;string str;cin >> str;for (i = 0; i < str.length(); i++){k = k % 50;if (str[i] == '1'){k += 10;grade += k;}else{k = 0;}} grade = grade / 50;switch (grade){case 0:printf("0\n");break;case 1:case 2:printf("1\n");break;case 3:case 4:printf("2\n");break;case 5:case 6:printf("3\n");break;case 7:case 8:printf("4\n");break;case 9:case 10:printf("5\n");break;case 11:case 12:printf("6\n");break;case 13:case 14:printf("7\n");break;default:printf("8\n");}}return 0;}
- UC browser
- UC Browser
- UC Browser
- CSU 1003 UC Browser
- 1003: UC Browser
- CSU 1003: UC Browser
- ACM:H: UC Browser
- COJ 1003: UC Browser
- CSU-ACM 1003: UC Browser
- 隐藏比较深的模拟题1003: UC Browser
- browser
- browser
- Browser
- browser
- UC
- UC
- Google Browser, Firefox Browser?
- Free MIB Browser / MIB Browser / SNMP Browser.
- dij(priority_queue)
- loaded the "XXXView" nib but the view outlet was not set 解决方案
- This a test paper
- Android中UI线程与后台线程交互设计的5种方法
- powerfactory installation
- UC Browser
- xStream异常
- 用于记忆的网络流sap
- c3p0 配置(转载)
- pci设备学习笔记
- 数据泵导数据
- Could not initialize class util.HibernateUtil ,servlet用hibernate报错
- Volley 源码笔记(1)
- C++ 字符串查找例子.