题目描述:

              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. PyTorch学习笔记之Tensors 2

    Tensors的一些应用 ''' Tensors和numpy中的ndarrays较为相似, 因此Tensor也能够使用GPU来加速运算 ''' # from _future_ import print ...

  2. openfire Android学习(二)----对分组、好友和头像等一些操作

    一.查询所有分组 通过Roster来获取所有分组,Roster可以通过connection.getRoster()来得到. [java] view plaincopy /** * 获取所有组 * *  ...

  3. win10 配置pylucene

    参考文章 http://lxsay.com/archives/269 Windows 10 64 Bit 编译安装 PyLucene 6.2, 6.4 或 6.5 POSTED ON 2017-02- ...

  4. SilverLight:基础控件使用(3)-DataGrid控件

    ylbtech-SilverLight-Basic-Control:基础控件使用(3)-DataGrid控件 DataGrid控件-后台绑定 自动生成表列 不自动生成表列 1.A,返回顶部Person ...

  5. linux下脚本监控网络流量

    linux下脚本监控网络流量 学习了:https://blog.csdn.net/chenghuikai/article/details/48437479 学习了:http://www.jb51.ne ...

  6. Thrift安装介绍

    一.简介 1.语言库要求 因为thrift支持多语言.所以编译thrift源代码的过程中,会用到该语言的一些类库.如c++的boost.java的jdk等. 那么,在安装thrift过程中,须要对各种 ...

  7. PCB常用单位转换 mil 英尺

    PCB常用单位转换 mil 英尺 相关常用单位     1mil   = 0.0254mm 100mil = 2.54mm 1英寸   = 1000mil = 2.54cm 1英尺   = 12英寸  ...

  8. 第 3 章 第 1 题 精简冗余 if 语句问题 使用数组实现

    问题分析 输入:用户个人收入 输出:该用户要缴纳的个人所得税 约束:不允许使用过多的 if 语句 解答思路 最简单的方法是根据不同的税率区间,创建多个 if 语句来求解.但如此一来便会有 25 个 i ...

  9. android:PopupWindow的使用场景和注意事项

    1.PopupWindow的特点 借用Google官方的说法: "A popup window that can be used to display an arbitrary view. ...

  10. 安卓Android手机直播推送同步录像功能设计与实现源码

    本文转自:http://blog.csdn.net/jyt0551/article/details/58714595 EasyPusher是一款非常棒的推送客户端.稳定.高效.低延迟,音视频同步等都特 ...