题目描述:

              Integer in C++

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 128000/64000 KB (Java/Others)

Problem Description

  KIDx: I like Java much more than C++, because I can use BigInteger in Java. :)

However, KIDx has to use C++ language to do a project...

Little KIDx knows 3 integer types in C++:

1) short occupies 2 bytes and allows you to store numbers from -32768 to 32767

2) int occupies 4 bytes and allows you to store numbers from -2147483648 to 2147483647

3) long long occupies 8 bytes and allows you to store numbers from -9223372036854775808 to 9223372036854775807

For all the types given above the boundary values are included in the value range. From this list, KIDx wants you to choose the smallest type that can store a positive integer n.

Input

  Each case contains a positive integer n. It consists of at least one digit and at most 30 digits. In addition, it doesn't contain any leading zeros.

Output

  For each line, print the first type from the list "short, int, long long", that can store the natural number n. If no one can store the number, just print "It is too big!".

Sample Input

102
50000
123456789101112131415161718192021222324

Sample Output

short
int
It is too big! 简单字符串处理,留作纪念!!!
竟然忘记了strcmp这个函数的强大功能,它的比较是按ASCII码表的。
 #include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
using namespace std; const int maxn = + ;
char s[maxn], t[maxn]; int main()
{
int i, len;
while (gets(s))
{
len = strlen(s);
if (s[] == '-')
{
int l = ;
for (i = ; i < len; i++)
t[l++] = s[i];
if ((strcmp(t, "") <= && l == strlen("")) || l < strlen(""))
puts("short");
else if ((strcmp(t, "") <= && l == strlen("")) || l < strlen(""))
puts("int");
else if ((strcmp(t, "") <= && l == strlen("")) || l < strlen("") )
puts("long long");
else
puts("It is too big!");
}
else
{
if ((strcmp(s, "") <= && len == strlen("")) || len < strlen(""))
puts("short");
else if ((strcmp(s, "") <= && len == strlen("")) || len < strlen(""))
puts("int");
else if ((strcmp(s, "") <= && len == strlen("")) || len < strlen(""))
puts("long long");
else
puts("It is too big!");
}
}
return ;
}

2013 gzhu 校赛的更多相关文章

  1. SCNU省选校赛第二场B题题解

    今晚的校赛又告一段落啦,终于"开斋"了! AC了两题,还算是满意的,英语还是硬伤. 来看题目吧! B. Array time limit per test 2 seconds me ...

  2. 2016 华南师大ACM校赛 SCNUCPC 非官方题解

    我要举报本次校赛出题人的消极出题!!! 官方题解请戳:http://3.scnuacm2015.sinaapp.com/?p=89(其实就是一堆代码没有题解) A. 树链剖分数据结构板题 题目大意:我 ...

  3. 2014上半年acm总结(1)(入门+校赛)

    大一下学期才开始了acm,不得不说有一点迟,但是acm确实使我的生活充实了很多,,不至于像以前一样经常没事干=  = 上学期的颓废使我的c语言学的渣的一笔..靠考前突击才基本掌握了语法 寒假突然醒悟, ...

  4. 2017CUIT校赛-线上赛

    2017Pwnhub杯-CUIT校赛 这是CUIT第十三届校赛啦,也是我参加的第一次校赛. 在被虐到崩溃的过程中也学到了一些东西. 这次比赛是从5.27早上十点打到5.28晚上十点,共36小时,中间睡 ...

  5. 2013年山东省赛F题 Mountain Subsequences

    2013年山东省赛F题 Mountain Subsequences先说n^2做法,从第1个,(假设当前是第i个)到第i-1个位置上哪些比第i位的小,那也就意味着a[i]可以接在它后面,f1[i]表示从 ...

  6. [蓝桥杯]2013蓝桥省赛B组题目及详解

    /*——————————————————————————————————————————————————————————— 题目:2013 高斯日记T-1 问题描述: 大数学家高斯有一个好习惯:无论如 ...

  7. 2013年省赛H题

    2013年省赛H题你不能每次都快速幂算A^x,优化就是预处理,把10^9预处理成10^5和10^4.想法真的是非常巧妙啊N=100000构造两个数组,f1[N],间隔为Af2[1e4]间隔为A^N,中 ...

  8. 2013年省赛I题 Thrall’s Dream

    2013年省赛I题判断单向联通,用bfs剪枝:从小到大跑,如果遇到之前跑过的点(也就是编号小于当前点的点),就o(n)传递关系. bfs #include<iostream> #inclu ...

  9. HZNU第十二届校赛赛后补题

    愉快的校赛翻皮水! 题解 A 温暖的签到,注意用gets #include <map> #include <set> #include <ctime> #inclu ...

随机推荐

  1. commons-lang3-RandomUtils

    随机工具类   RandomUtils nextBoolean() 返回一个随机boolean值 nextBytes(int count) 返回一个指定大小的随机byte数组 nextDouble() ...

  2. lfu-cache(需要O(1),所以挺难的)

    https://leetcode.com/problems/lfu-cache/ 很难,看了下面的参考: https://discuss.leetcode.com/topic/69137/java-o ...

  3. 自己定义一个Dialog样式的Activity窗体,切换到Dialog的方法

    首先定义一个style 在style里面加入 <style name="MyDialog" parent="@android:Theme.Dialog"& ...

  4. react webapp 开发小结

    1.监听props的方法 componentWillReceiveProps(nextProps) { // } 2.监听state的方法 3.props 传递的方法 <AlarmList {. ...

  5. One usage of recurison: the tower of Hanoi

    Statements: This blog was written by me, but most of content  is quoted from book[Data Structure wit ...

  6. VueJS处理逻辑指令:v-if

    HTML <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <titl ...

  7. Codeforces 569 B. Inventory

    click here~~ **B. Inventory** time limit per test1 second memory limit per test256 megabytes inputst ...

  8. EC知识总结ITE5570

    以笔记本上的EC ITE5570进行讲解  ITE EC代码解析 1.一简介 EC(Embed Controller,嵌入式控制器)是一个16位单片机,它内部本身也有一定容量的Flash来存储EC的代 ...

  9. C---指针篇

    指针变量:专门存放内存地址的一种变量 听说C因为指针而强大 一段代码来解释 指针 *指针 &指针 &指向变量 的关系 /* * 返回指针所指向内存地址中存放的值 它是单目运算符 也称作 ...

  10. HDU 1418 抱歉 (欧拉公式)

    [题目链接]:pid=1418">click here~~ [题目大意]: 假设平面上有n个点,而且每一个点至少有2条曲线段和它相连,就是说,每条曲线都是封闭的.同一时候,我们规定: ...