【poj4011】Automated Telephone Exchange

题目:Automated Telephone Exchange

poj URL:http://poj.org/problem?id=4011

原题如下图:

题意:

就是一个三位数减去两个小于或等于99的数的差为0,满足这个条件的数的个数。只要用标准输入输出就可以了。

下面是我Accepted的代码:

 1 #include <iostream>
 2 using namespace std;
 3 
 4 int main()
 5 {
 6     int ATE;
 7     cin >> ATE;
 8     int out = 0;
 9     int a,b;
10     for(a = 0;a<100;a++){
11         b = ATE-a;
12         if(b >= 0 and b <= 99) out++;
13     }
14     cout << out;
15     return 0;
16 }

PS:好水的一道题呀 T T

原文地址:https://www.cnblogs.com/baodaren/p/5160187.html