Automated Telephone Exchange
Time Limit: 3000MS Memory limit: 65536K
题目描述
In St Petersburg phone numbers are formatted as “XXX–XX–XX”, where the first three digits represent index of the Automated Telephone Exchange (ATE). Each ATE has exactly 10000 unique phone numbers.Peter has just bought a new flat and now he wants to install a telephone line. He thinks that a phone number is lucky if the arithmetic expression represented by that phone number is equal to zero. For
example, the phone number 102–40–62 is lucky (102-40-62 = 0), and the number 157–10–47 is not lucky (157-10-47 = 100 != 0).
Peter knows the index of the ATE that serves his house. To get an idea of his chances to get a lucky number he wants to know how many lucky numbers his ATE has.
输入
The input file contains a single integer number n — the index of Peter’s ATE (100 <= n <= 999).
输出
Output a single integer number — the number of lucky phone numbers Peter’s ATE has.
示例输入
196
239示例输出
3
0
题目意思:一个人有个喜好,对于XXX-XX-XX这种电话号码,他喜欢让他的的值为0,也就是 XXX-XX-XX=0;
给出XXX,求出有多少种情况满足他喜欢的号码
注意:xx可能是01。02这种啊
代码很简单,不解释
#include<stdio.h>
int main()
{
int a,b,n;
while(~scanf("%d",&n))
{
if(n>)
printf("0\n");
else
{
b=(-n/)*;
if(n%==)
b+=;
printf("%d\n",b);
}
}
return ;
}
Automated Telephone Exchange的更多相关文章
- 【poj4011】Automated Telephone Exchange
题目:Automated Telephone Exchange poj URL:http://poj.org/problem?id=4011 原题如下图: 题意: 就是一个三位数减去两个小于或等于99 ...
- exchange From Middle English eschaunge
exchange From Middle English eschaunge, borrowed from Anglo-Norman eschaunge exchange 1.An act of ex ...
- poj1144 求不同割点的个数
Network Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11914 Accepted: 5519 Descript ...
- poj 1144 Network 图的割顶判断模板
Network Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 8797 Accepted: 4116 Descripti ...
- poj1144
Network Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 12521 Accepted: 5760 Descript ...
- POJ 1144 Network(Tarjan求割点)
Network Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 12707 Accepted: 5835 Descript ...
- UVA 315 315 - Network(求割点个数)
Network A Telephone Line Company (TLC) is establishing a new telephone cable network. They are con ...
- uva 315 Network(无向图求割点)
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- poj 1144 Network【双连通分量求割点总数】
Network Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 11042 Accepted: 5100 Descript ...
随机推荐
- android ScrollView 充满屏幕
android:fillViewport=true ScrollView下面的组件如果有android:layout_height="fill_parent"或android:la ...
- mysql 参数:[read_buffer_size] [sort_buffer_size] [read_rnd_buffer_size] [tmp_table_size]---图解
http://imysql.cn/2008_09_27_deep_into_mysql_sort_buffer http://my.oschina.net/realfighter/blog/36442 ...
- Mysql新建用户和数据库并授权
测试环境:Centos 6.3和Mysql 5.3 一.新建用户 //登录MYSQL@>mysql -u root -p@>密码//创建用户mysql> insert into my ...
- Elasticsearch .Net Client NEST 多条件查询示例
Elasticsearch .Net Client NEST 多条件查询示例 /// <summary> /// 多条件搜索例子 /// </summary> public c ...
- Java基础知识强化之集合框架笔记25:Vector的特有功能
1. Vector的特有功能: (1)添加功能 public void addElement(Object obj) -- add() (2)获取功能 pu ...
- js request
比如你要获取aaa.aspx?id=2 使用方法为:var id= request('id');
- c# try..... catch
功能说明:在此例中,try 块包含对可能导致异常的ProcessString()方法的调用.catch子句包含仅在屏幕上显示消息的异常处理程序,当从ProcessString内部调用throw语句时, ...
- 手势交互之GestureOverlayView
一种用于手势输入的透明覆盖层,可以覆盖在其他空间的上方,也可包含在其他控件 android.gesture.GestureOverlayView 获得手势文件 需要用GesturesBuilder,如 ...
- Spring通过SchedulerFactoryBean实现调度任务的配置
http://blog.csdn.net/hu_shengyang/article/details/19815201(里面是配置) 介绍SchedulerFactoryBean http://blog ...
- c++异常机制实现原理
今天突然看到一篇文章,讲异常机制的实现,所以分享一下:http://baiy.cn/doc/cpp/inside_exception.htm 内容讲的很深,但是编译器的实现是不是真是这样就不知道了,我 ...