自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(15)
  • 收藏
  • 关注

原创 A + B Problem II

A + B Problem II Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer ...

2018-12-21 21:52:38 132

原创 取石子游戏

取石子游戏 原理 威佐夫博弈 相关链接 https://blog.csdn.net/y990041769/article/details/21694007 题目链接 http://poj.org/problem?id=1067 Description 有两堆石子,数量任意,可以不同。游戏开始由两个人轮流取石子。游戏规定,每次有两种不同的取法,一是可以在任意的一堆中取走任意多的石子;二是可以...

2018-12-14 00:54:53 117

原创 整除的尾数

整除的尾数 问题链接 http://acm.hdu.edu.cn/showproblem.php?pid=2099 Problem Description 一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input 输入数据有若干组,每组数据包含二个整数a,b(0<a<10000, 10<b<100),若遇到0 0则处理结束。 Out...

2018-12-12 19:07:48 170

原创 Climbing Worm

Climbing Worm 问题链接 http://acm.hdu.edu.cn/showproblem.php?pid=1049 Problem Description An inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but th...

2018-12-12 18:42:52 225

原创 钱币兑换问题

钱币兑换问题 问题链接 http://acm.hdu.edu.cn/showproblem.php?pid=1284 Problem Description 在一个国家仅有1分,2分,3分硬币,将钱N兑换成硬币有很多种兑法。请你编程序计算出共有多少种兑法。 Input 每行只有一个正整数N,N小于32768。 Output 对应每个输入,输出兑换方法数。 Sample Input 2934 125...

2018-12-11 22:55:34 1128

原创 H - Problem H

H - Problem H 问题分析 先将输入的负的坐标值变为正数,计算移动距离s减去坐标和a+b的值,若结果为正并能被2整除则输出Yes,否则No. #include<iostream> using namespace std; int main() { long int a,b,s,x; cin>>a>>b>>s; if(a<0)a=-a;...

2018-12-09 18:44:31 122

原创 D - Problem D

D - Problem D 给定三条边,请你判断一下能不能组成一个三角形。 问题分析 创建动态数组保存输入的每组数据。再用循环判断每组数据. #include<iostream> using namespace std; int main() { int n,i=0; cin>>n; double *a=new double[n]; double *b=new do...

2018-12-09 18:36:39 186 1

原创 A - Problem A

A - Problem A One hot summer day Pete and his friend Billy decided to buy a watermelon. They chose the biggest and the ripest one, in their opinion. After that the watermelon was weighed, and the scal...

2018-12-09 18:33:10 140

原创 A + B Problem Too

A + B Problem Too 问题分析 用whlie循环记录每一对数,接着再判断是否能被86整除. #include<iostream> using namespace std; int main() { int a, b; while (cin >> a >> b) { if ((a + b) % 86==0) cout

2018-12-07 20:48:24 73

原创 计算球体积

计算球体积 输出对应的球的体积,对于每组输入数据,输出一行,计算结果保留三位小数。 问题分析 用while循环记录r的值,用printf语句保留三位小数. #include<iostream> using namespace std; #define PI 3.1415927 int main() { double r,V; while (cin >> r) { ...

2018-12-07 20:34:55 131

原创 ASCII码排序

ASCII码排序 问题 输入三个字符后,按各字符的ASCII码从小到大的顺序输出这三个字符。 问题分析 定义一个交换字符的函数(引用类型参数 ),用选择排序法排序输出。 #include<iostream> using namespace std; void sort(char & a,char & b) { char temp; temp = a; a = b;...

2018-12-07 19:46:47 142

原创 A + B Problem

A + B Problem 问题分析 建立循环能计算多对数的和。 #include<iostream> using namespace std; int main() { int a, b; while(cin>>a>>b) { cout << a + b << endl; } system(" pause"); retu...

2018-12-07 19:30:58 100

原创 Stones on the Table

Stones on the Table 问题分析 用循环判断第一个石头颜色与第二个石头颜色是否相同,是就计数加一;否就比较第二个石头与第三个石头的颜色,依次类推 直到倒数第二个和最后一个。 #include<iostream> using namespace std; int main() { int n,i,x=0; char a[50] = { 0 }; cin >&g...

2018-12-07 19:26:44 67

原创 George and Accommodation

George and Accommodation 问题分析 用循环计算n对数的差值是否大于等于二。 #include<iostream> using namespace std; int main() { int n, i = 0, j = 0, p, q; cin >> n; for(;i<n;i++) { cin

2018-12-07 19:12:53 108

原创 String Task

#include<iostream> using namespace std; int main() { char a[101], b[201]; char *s = a; cin >> a; int j = 0; for (int i = 0; *(s + i) != 0; i++) {

2018-12-07 19:01:58 72

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除