问题 F: F.Turing equation

时间限制: 1 Sec  内存限制: 128 MB
提交: 19  解决: 1
[提交][状态][讨论版]

题目描述

The fight goes on,whether to store numbers starting with their most significant digit ortheir least significant digit. Sometimes this is alsocalled the "Endian War". The battleground dates farback into the early days of computer science. Joe Stoy, in his (bythe way excellent) book "Denotational Semantics", tellsfollowing story:

"Thedecision which way round the digits run is, of course, mathematicallytrivial. Indeed, one early British computer had numbers running fromright to left (because the spot on an oscilloscope tube runs fromleft to right, but in serial logic the least significant digits are dealtwith first). Turing used to mystify audiences at public lectures when, quite byaccident, he would slip into this mode even for decimal arithmetic, andwrite things like 73+42=16. The next version of the machinewas made more conventional simply by crossing the x-deflectionwires: this, however, worried the engineers, whosewaveforms were all backwards. That problem was in turn solved by providinga little window so that the engineers (who tended to be behind the computeranyway) could view the oscilloscope screen from the back.

You will play therole of the audience and judge on the truth value of Turing's equations.

输入

he input containsseveral test cases. Each specifies on a single line a Turing equation. A Turingequation has the form "a+b=c", where a, b, c are numbers made up ofthe digits 0,...,9. Each number will consist of at most 7 digits. This includespossible leading or trailing zeros. The equation "0+0=0" will finishthe input and has to be processed, too. The equations will not contain anyspaces.

输出

For each test casegenerate a line containing the word "TRUE" or the word"FALSE", if the equation is true or false, respectively, in Turing'sinterpretation, i.e. the numbers being read backwards.

样例输入

73+42=16

5+8=13

0001000+000200=00030

0+0=0

样例输出

TRUE

FALSE

TRUE

cpp:

#include<stdio.h>
#include<string.h>
int main(void)
{  char str[110];  while(gets(str))  {  int num1=0,num2=0,num3=0;  int i,j,k;  int len1=strlen(str)-1;  for(i=len1;i>=0;i--)  {  if(str[i]=='=')  j=i;  if(str[i]=='+')  k=i;  }  for(i=len1;i>j;i--)  {  num3=num3*10+(str[i]-48);  }  for(i=j-1;i>k;i--)  {  num2=num2*10+(str[i]-48);  }  for(i=k-1;i>=0;i--)  {  num1=num1*10+(str[i]-48);  }  if(num1==0&&num2==0&&num3==0)  break;  else if(num1+num2==num3)  {  printf("TRUE\n");            }  else  {  printf("FALSE\n");  }          }  return 0;  } 

Turing equation相关推荐

  1. 河南省第七届省赛 问题 F: Turing equation 水题

    **题目描述 The fight goes on, whether to store numbers starting with their most significant digit or the ...

  2. NYOJ 1253 Turing equation (第七届河南省赛)

    Turing equation 时间限制:1000 ms | 内存限制:65535 KB 难度:1 描述 The fight goes on, whether to store numbers sta ...

  3. NYOJ 1253 Turing equation【题意是关键,模拟】

    Turing equation 时间限制:1000 ms  |  内存限制:65535 KB 难度:1 描述 The fight goes on, whether to store  numbers ...

  4. 第七届河南省赛部分题

    10401: A.物资调度 Time Limit: 2 Sec  Memory Limit: 128 MB Submit: 106  Solved: 62 [Submit][Status][Web B ...

  5. 何为Turing Machine(图灵机)?

    1.什么是人工智能? 定义:The study and design of intelligent agents 相关书籍:<人工智能:一种现代的方法> 2.图灵机简介: 可能是 agen ...

  6. Turing渲染着色器网格技术分析

    Turing渲染着色器网格技术分析 图灵体系结构通过使用 网格着色器 引入了一种新的可编程几何着色管道.新的着色器将计算编程模型引入到图形管道中,因为协同使用线程在芯片上直接生成紧凑网格( meshl ...

  7. NVIDIA Turing Architecture架构设计(下)

    NVIDIA Turing Architecture架构设计(下) GDDR6 内存子系统 随着显示分辨率不断提高,着色器功能和渲染技术变得更加复杂,内存带宽和大小在 GPU 性能中扮演着更大的角色. ...

  8. NVIDIA Turing Architecture架构设计(上)

    NVIDIA Turing Architecture架构设计(上) 在游戏市场持续增长和对更好的 3D 图形的永不满足的需求的推动下, NVIDIA ®已经将 GPU 发展成为许多计算密集型应用的世界 ...

  9. 创建此对象的程序是quation_MathType出现此对象创建于Equation中的处理教程

    有那么一部份多朋友还不熟悉MathType出现此对象创建于Equation中怎么处理?下面小编就讲解MathType出现此对象创建于Equation中的处理教程,希望对你们有所帮助哦. MathTyp ...

最新文章

  1. mybatis mysql 配置文件_Mybatis配置文件详解(4)
  2. QT 建立信号和槽的联系(事件处理)
  3. ADO.NET Entity Framework如何:通过每种类型一个表继承以定义模型(实体框架)
  4. Windows Phone中使用Local DataBase与ISolateStorage—在MVVM模式下(—)
  5. Universal-Image-Loader(UIL)图片载入框架使用简介
  6. echarts使用大总结
  7. Android Studio 创建第一个Android工程项目
  8. [学习笔记]半平面交
  9. Oracle分页查询语句(一)
  10. 蓦然回首,已然踏上编程路
  11. 树莓派 pico pio 可编程io
  12. JAVA实现UTC时间转换成北京时间
  13. c语言n的阶乘 longfact,如何定义函式fact(n) 计算n的阶乘:n!=1*2*……*n,函式返回值型别是double?...
  14. python程序文件扩展名主要是什么_python程序文件扩展名知识点详解
  15. 基于VUE3的电子病历编辑器
  16. 深度相机原理揭秘之飞行时间法(TOF)
  17. python launcher下载,python launcher是什么 python的launcher用法知识点总结
  18. AutoHotKey脚本:帝国时代(罗马复兴)秘籍快速输入
  19. 手把手教你使用java对接微信公众号-获取地理位置信息
  20. rackstation服务器显示器,群晖发布RackStation RS3618xs 2U可扩展存储服务器

热门文章

  1. Lync与Exchange 2013 UM集成:Lync Server配置
  2. CISCO PIX防火墙的配置
  3. python量化数据处理小细节(以后还会不断补充)
  4. IDEA详细配置与使用
  5. TCP如何利用不可靠的IP协议实现可靠传输
  6. Python多线程--互斥锁、死锁
  7. python堆栈反向输出列表_python - IPython:将Python脚本的输出重定向到文件(如bash) - 堆栈内存溢出...
  8. python神奇的小海龟_Python笔记_第一篇_面向过程_第一部分_8.画图工具(小海龟turtle)...
  9. Vue.js前后端分离2
  10. Java笔记01-数组相关