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 ...
随机推荐
- hdu-5009-Paint Pearls-dp
由题意我们能够知道,花费最多为n. 所以单次最多涂掉sqrt(n)种颜色. dp[i]:涂到第i个位置.之前的花费最少为多少. biao[i][j]:在第i个位置,往前涂j-1种颜色,涂到哪个位置. ...
- 解读dbcp自动重连那些事---转载
http://agapple.iteye.com/blog/791943 可以后另一篇做对比:http://agapple.iteye.com/blog/772507 同样的内容,不同的描述方式,不一 ...
- MySQL Error Handling in Stored Procedures---转载
This tutorial shows you how to use MySQL handler to handle exceptions or errors encountered in store ...
- Oracle数据库管理员经常使用的表和视图
◆dba_开头 dba_users 数据库用户信息 dba_segments 表段信息 dba_extents 数据区信息 dba_objects 数据库对象信息 dba_tablespaces 数据 ...
- 动态拼接 sql的时候 里面 如果有变量的话 按上面的方式进行处理
set @Sql_Sql = N' select top 1 @m_zw=zw,@m_zh=temp from ket where zd=''ddd'' ' print @Sql_Sql EXEC s ...
- MVC3.0 提交表单的方法
在views中使用 @using (Html.BeginForm()) 来完成,其中放一个submit类型的提交按钮,如: @using (Html.BeginForm()) { @Html.Vali ...
- 关于URL 解码, 编码
由于近期客户需要用到CA认证,此CA认证采用的是URL方式出传值 使用指定的编码对象将 URL 编码的字符串转换为已解码的字符串. 编码个人理解就是将某字符串以某种方式储存起来,而解码则以其编码格式得 ...
- A除以B_2
本题要求计算A/B,其中A是不超过1000位的正整数,B是1位正整数.你需要输出商数Q和余数R,使得A = B * Q + R成立. 输入格式: 输入在1行中依次给出A和B,中间以1空格分隔. 输出格 ...
- 直接修改workspace下的配置文件与tomcat下的文件
项目中直接修改workspace下的配置文件与tomcat下的文件,可是还有错误,例如修改了4个配置文件中的一个配置文件.经查如下: 直接修改workspace下的配置文件与tomcat下的文件,可能 ...
- hibernate4.3.8整合struts2过程中遇到的问题
1.遇到的异常: Exception in thread "main" org.hibernate.service.spi.ServiceException: Unable to ...