POJ 2572
#include<stdio.h>
#include<iostream>
#include<string>
using namespace std; int main()
{
//freopen("acm.acm","r",stdin);
string s;
int pos;
int pos1;
string s1;
string s2;
string s3;
int i;
int sum1;
int sum2;
int sum3;
while(cin>>s)
{
sum1 = ;
sum2 = ;
sum3 = ;
pos = s.find('+');
s1.assign(s.begin(),s.begin()+pos);
for(i = s1.length()-; i >= ; -- i)
{
sum1 = sum1* + s1[i]-'';
}
pos1 = s.find('=');
s2.assign(s.begin()+pos+,s.begin()+pos1);
for(i = s2.length()-; i >= ; -- i)
{
sum2 = sum2* + s2[i]-'';
}
s3.assign(s.begin()+pos1+,s.end());
for(i = s3.length()-; i >= ; -- i)
{
sum3 = sum3* + s3[i]-'';
}
if(sum3 == sum1 + sum2)
cout<<"True"<<endl;
else
cout<<"False"<<endl;
}
}
POJ 2572的更多相关文章
- poj 2572 Hard to Believe, but True!
Hard to Believe, but True! Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 3537 Accep ...
- 【POJ 2572 Advertisement】
Time Limit: 1000MSMemory Limit: 10000K Total Submissions: 947Accepted: 345Special Judge Description ...
- poj和hdu部分基础算法分类及难度排序
最近想从头开始刷点基础些的题,正好有个网站有关于各大oj的题目分类(http://www.pythontip.com/acm/problemCategory),所以写了点脚本把hdu和poj的一些题目 ...
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
随机推荐
- 2018.11.17 hdu5829Rikka with Subset(ntt)
传送门 nttnttntt基础题. 考虑计算每一个数在排名为kkk时被统计了多少次来更新答案. 这样的话,设anskans_kansk表示所有数的值乘上排名为kkk的子集数的总和. 则ansk=∑i ...
- TortoiseGit使用笔记
不喜欢敲命令行,或者用惯TortoiseSVN的也可以使用TortoiseGit 1. TortoiseGit安装 安装很简单,默认安装就可以.需要安装以下几个软件: l Git-2.14.3-64- ...
- OSI七层模型和TCP/IP四层模型
1)网络层负责点到点的传输(这里的“点”指主机或路由器),而传输层负责端到端的传输(这里的“端”指应用进程) 2)ARP协议介于数据链路层和网络层之间(IPv4专有,IPv6的地址映射功能在ICMPv ...
- 【服务器】Nginx文件配置
nginx.conf文件 #运行用户 user nobody; #启动进程,通常设置成和cpu的数量相等 worker_processes 1; #全局错误日志及PID文件 #error_log lo ...
- IntelliJ IDEA 2017版 spring-boot 拦截器的操作三种方式
一.注解方式 @WebServlet(urlPatterns = "/myServlet") public class MyServlet extends HttpServlet ...
- Linux下通过管道杀死所有与tomcat相关的进程
先将正确的命令放上来: ps -ef | grep ps -ef将系统中运行的进程展示出来 选择带有tomcat的进程后同时去除自身带有grep的进程,毕竟本身运行的这条命令是与tomcat相关的 a ...
- php 爬虫简单示例
<?php error_reporting(E_ALL^E_NOTICE^E_WARNING); $url = "http://cp.360.cn/ssccq/?menu&r_ ...
- Java EE Servlet 几个path
ContextPath Context ['kɒntekst] 不识庐山真面目,只缘身在此山中. 相对路径 RealPath 绝对路径 ServletPath 就是servlet-mapping 中 ...
- 常见笔记本进入bios方法
联想 y510p ->F2 ThinkPad E431 -> Fn + F1
- android的消息处理机制(图文+源码分析)—Looper/Handler/Message[转]
from:http://www.jb51.net/article/33514.htm 作为一个大三的预备程序员,我学习android的一大乐趣是可以通过源码学习google大牛们的设计思想.andro ...