#include <stdio.h>
#include <stdlib.h>
#include<string.h>
int main()
{
int n,len;
char str[];
scanf("%d",&n);
while(n--)
{
int tmp;
scanf("%s",str);
len=strlen(str);
tmp = str[len-] - ''+str[len-] - '';
if(tmp != )
{
printf("0\n");
continue;
}
else
{
if(len == )
tmp = str[len-]-'';
else
tmp = str[len-] - '' + (str[len-] - '')*;
if(tmp <= )
printf("%d\n",tmp+);
else
printf("%d\n",tmp-);
}
}
return ;
}
//
#include<stdio.h>
main()
{
int t,a,b;
scanf("%d",&t);
while(t--)
{
scanf("%d:%d",&a,&b);
b?puts(""):printf("%d\n",a>?a-:a+);
}
}

一开始的想法是因为输入的??:??所以以为只能把他作为串来放进数组,可是大神用了13行就写出来了,scanf("%d:%d",&h,&m)

poj2840的更多相关文章

随机推荐

  1. sencha touch 2.3 结合cordova 环境搭建

    sencha touch 2.3环境搭建必备工具 sencha touch 2.3 包sencha cmd 4.0以上JAVA JDK 1.7以上(注意JDK和JRE的区别)Ruby 1.9.3或更早 ...

  2. codevs 1922 骑士共存问题 网络流

    题目链接 给一个n*n的棋盘, 上面有障碍物, 有障碍物的不能放东西.然后往上面放马, 马不能互相攻击, 问最多可以放多少个马. 按x+y的奇偶来划分, 如果两个格子可以互相攻击, 就连一条权值为1的 ...

  3. TensorFlow 深度学习笔记 Logistic Classification

    Logistic Classification Github工程地址:https://github.com/ahangchen/GDLnotes 欢迎star,有问题可以到Issue区讨论 官方教程地 ...

  4. Google TensorFlow深度学习笔记

    Google Deep Learning Notes Google 深度学习笔记 由于谷歌机器学习教程更新太慢,所以一边学习Deep Learning教程,经常总结是个好习惯,笔记目录奉上. Gith ...

  5. Oracle EBS-SQL (MRP-1):检查期间内计划完成的任务.sql

    /*期间内车间任务下达记录数不包含配件任务*/ select     WE.DESCRIPTION                                                任务说 ...

  6. CC++初学者编程教程(9) Windows8.1安装VS2013并捆绑QT与编程助手

    我们在Windows8.1安装VS2013并捆绑QT与编程助手需要下列文件. 2. 在虚拟机中开启Windows8.1 3.然后选择VS2013的安装镜像. 4.将镜像复制到虚拟机. 5.我们装载这个 ...

  7. 【操作系统】linux创建子进程--fork()方法

    (1)fork()的定义 fork()函数是Unix中派生新进程的唯一方法,声明如下: #include <unistd.h> pid_t fork(void); 我们需要理解的是,调用一 ...

  8. OpenStreetMap(OSM) features

    目录 1 Primary features 1.1 Aerialway 1.2 Aeroway 1.3 Amenity 1.3.1 Sustenance 1.3.2 Education 1.3.3 T ...

  9. gitlab 安装报错:Could not find modernizr-2.6.2 in any of the sources

      2014-04-30 15:27:44 标签:gitlab 原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://davidbj.b ...

  10. ios 常用宏(copy)

    分享一下我现在用的 ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 3 ...