A + B Problem

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 654986    Accepted Submission(s): 204210

Problem Description
Calculate A + B.
 
Input
Each line will contain two integers A and B. Process to end of file.
 
Output
For each case, output A + B in one line.
 
Sample Input
1 1
 
Sample Output
2
 
Author
HDOJ
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1000
分析:我的第一道用指针做的题,初学指针,以前也从来没有用过指针,试试水,就来道A+B,大牛就不要喷了,Orz! 
下面给出AC代码:
 #include <bits/stdc++.h>
using namespace std;
int main()
{
int *p,*q,m,n;
int ans;
p=&m;
q=&n;
while(scanf("%d%d",p,q)!=EOF)
{
ans=*p+*q;
printf("%d\n",ans);
}
return ;
}

HDU 1000 A + B Problem(指针版)的更多相关文章

  1. HDU 1000 A + B Problem

    #include int main() { int a,b; while(scanf("%d%d",&a,&b)!=EOF) printf("%d\n&q ...

  2. hdu 1277 AC自动机入门(指针版和数组版)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1277 推荐一篇博客(看思路就可以,实现用的是java): https://www.cnblogs.co ...

  3. [HDU - 5170GTY's math problem 数的精度类

    题目链接:HDU - 5170GTY's math problem 题目描述 Description GTY is a GodBull who will get an Au in NOI . To h ...

  4. 抓起根本(二)(hdu 4554 叛逆的小明 hdu 1002 A + B Problem II,数字的转化(反转),大数的加法......)

    数字的反转: 就是将数字倒着存下来而已.(*^__^*) 嘻嘻…… 大致思路:将数字一位一位取出来,存在一个数组里面,然后再将其变成数字,输出. 详见代码. while (a) //将每位数字取出来, ...

  5. 字典树模板( 指针版 && 数组版 )

    模板 :  #include<string.h> #include<stdio.h> #include<malloc.h> #include<iostream ...

  6. HDU 5832 A water problem(某水题)

    p.MsoNormal { margin: 0pt; margin-bottom: .0001pt; text-align: justify; font-family: Calibri; font-s ...

  7. hdu 1402 A * B Problem Plus FFT

    /* hdu 1402 A * B Problem Plus FFT 这是我的第二道FFT的题 第一题是完全照着别人的代码敲出来的,也不明白是什么意思 这个代码是在前一题的基础上改的 做完这个题,我才 ...

  8. HDU 4291 A Short problem(2012 ACM/ICPC Asia Regional Chengdu Online)

    HDU 4291 A Short problem(2012 ACM/ICPC Asia Regional Chengdu Online) 题目链接http://acm.hdu.edu.cn/showp ...

  9. hdu 2993 MAX Average Problem(斜率DP入门题)

    题目链接:hdu 2993 MAX Average Problem 题意: 给一个长度为 n 的序列,找出长度 >= k 的平均值最大的连续子序列. 题解: 这题是论文的原题,请参照2004集训 ...

随机推荐

  1. Charles 抓包工具使用部分问题总结

    一. You may need to configure your browser or application to trust the Charles Root Certificate. See ...

  2. ES6数组及数组方法

    ES6数组可以支持下面的几种写法: (1)var [a,b,c] = [1,2,3]; (2)var [a,[[b],c]] = [1,[[2],3]]; (3)let [x,,y] = [1,2,3 ...

  3. Python学习日记:day8-------文件操作

    文件操作 1,文件路径:d:\xxxx.txt     绝对路径:从根目录到最后     相对路径:当前目录下的文件 2,编码方式:utf-8 3,操作方式:只读,只写,追加,读写,写读...... ...

  4. Python学习(五):易忘知识点

    1.列表比较函数cmp >>> a = [1,2,3,4] >>> b = [1,2,3,4,5] >>> c = [1,2,3,4] >& ...

  5. Oracle 用户操作表权限

    grant select any table to xxx 将使得xxx用户能够查看到所有用户的表:正确的授权不能是这样: 用户是隔离表的schema,授权时..

  6. java递归实现文件夹文件的遍历输出

    学习java后对一个面试小题(今年年初在团结湖面试的一个题目) 的习题的编写. ''给你一个文件,判断这个文件是否是目录,是目录则输入当前目录文件的个数和路径,''' /** * @author li ...

  7. [E::hts_idx_push] NO_COOR reads not in a single block at the end 10 -1

    在分析转录组数据时,用bowtie2比对生成的bam文件,下一步call peak使用m6Aviewer,需要bam文件的index文件.所以我直接敲命令 samtools index xx.bam ...

  8. 中文代码示例之Angular入门教程尝试

    原址: https://zhuanlan.zhihu.com/p/30853705 原文: 中文代码示例教程之Angular尝试 为了检验中文命名在Angular中的支持程度, 把Angular官方入 ...

  9. 怎么制作html5网站页面让它适应电脑和手机的尺寸

    https://zhidao.baidu.com/question/918130826792192539.html 用以下代码开头:<!DOCTYPE HTML><html>& ...

  10. 线程安全Dictionary

    public abstract class ReadFreeCache<TKey, TValue> { protected ReadFreeCache() : this(null) { } ...