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 ...
随机推荐
- (转载)Windows 7 Ultimate(旗舰版)SP1 32/64位官方原版下载(2011年5月12日更新版)
MSDN于2011年5月12日,最新发布简体中文Windows 7 Ultimate 旗舰版 SP1 DVD镜像安装包,分32位和64位两个版本.最新发行代号分别是:677486(32位),67740 ...
- 设置textView或者label的行间距方法
一,效果图. 二,代码. RootViewController.m - (void)viewDidLoad { [super viewDidLoad]; // Do any additional se ...
- frame模型
#import "CZWeiboFrame.h" #import "CZWeibo.h" @implementation CZWeiboFrame #defin ...
- Bash关闭输出(关闭正确、错误输出)
利用&>重定向,不输出任何内容: echo hello &> /dev/null 关闭正确输出: echo hello 1> /dev/null 关闭错误输出: ec ...
- node.js中文资料导航
以下资料来自gitHUb上面:https://github.com/youyudehexie/node123 Node.js HomePage Node官网七牛镜像 Infoq深入浅出Node.js系 ...
- JS根据key值获取URL中的参数值,以及把URL的参数转换成json对象
//把url的参数部分转化成json对象 parseQueryString: function (url) { var reg_url = /^[^\?]+\?([\w\W]+)$/, reg_par ...
- jquery 银行卡号验证
具体参考:https://github.com/jondavidjohn/payform 插件js: jquery.payform.js 具体操作 alert($.payform.validateCa ...
- SQL存储过程基于字段名传入的字符串拼接.
--定义存储过程. Create PROCEDURE Usp_Static ), ), --分组字段. ), --统计字段. ), --表头字段. ) --聚会函数. AS ) --存储游标执行的列. ...
- 分离数据库(Detach database).
Many times, we often needs to detach our databases if we want to copy it to another database instanc ...
- java中怎么进行字符串替换?
String str = "test.doc"; String newStr = str.replaceAll("doc","html");