自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 括号匹配I

Inuyasha得到了一个由"("和")"组成的字符串,比如"(())()","()","(()(()))"是括号匹配的,而")(","(()","(()))("是括号不匹配的。 为了让这个字符串括号匹配,Inuyasha可以去除某些括号。 他想知道,他能得到的最长的括号匹配的字符串有多长? Input 本题有多组测试数据,输入的第一行是一个整数T代表着测试数据的数

2013-10-24 12:59:30 672

原创 输出二进制数

Input 第一行:输入数字T 表示接下来将有T组输入数据 接下来T行,每行输入一个数字N (0 Output 输出该数字的二进制 注意:0 输出 0 Sample Input 5 0 1 2 3 4 Sample Output 0 1 10 11 100 #include #include vo

2013-10-24 12:57:46 784

原创 摆布大三角

7 3   8 8   1   0 2   7   4   4 4   5   2   6   5 (Figure 1) Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts at the t

2013-10-24 12:56:10 843

原创 绝对值

小灰灰又不开心了,因为他老爸灰太狼又要他做作业了,做不出来不给羊吃,怎么办呢?小灰灰跟聪明的你是好朋友,好朋友的你肯定不忍心看小灰灰这么不开心啦,所以你要帮他解决掉他的作业,题目如下: 给定任意实数n, 要求输出n的绝对值 (-10^9 Input 第一行,给定一个正整数T (0 第二行,输入一个任意实数N; 处理到文件结束; Output 输出N的绝对值; Sample I

2013-10-24 12:53:22 585

原创 4.1E2

E2. Write the C++ statements that are needed to create the linked configuration of nodes shown in each of the flloeing diagrams.For each part,embed these statements as part of a program that printfs t

2013-09-05 17:31:52 486

原创

栈的练习 书上例题: #include #include using namespace std; const int maxstack=10; enum error_code {     stack(),bool empty()const,pop(),top(Stack_entry&item)const,push(const Stack_entry&item) }; clas

2013-08-28 20:54:06 514

原创 括号匹配

#include #include char str[1000005],ttr[1000005]; int main() { int x,len,i,k,flag,ji; scanf("%d",&x); getchar(); while(x--) { flag=0; gets(str); ji=0; len

2013-08-28 20:35:41 457 1

原创 初学 栈的定义

标准模板库: #include #include using namespace std; int main() {     int n;     double item;     stacknumbers;     cout             cin>>n;     for(int i=0;i     {         cin>>item;    

2013-08-27 20:15:54 420

原创 第一章

本章首先概述良好程序设计的重要原理,特别是它们在大型项目中的应用;然后介绍用于发现有效算法的方法。 一)学习数据结构: • c++允许数据抽象:这意味着程序设计员能创造新的类型来表达方便其应用程序的 任何数据集合。 • c++支持面向对象的设计,在面向对象的设计中,程序设计员定义的类型在算法实 现中起到中心作用. . 重要的是,正如允许面向对象的方法, c++ 允许使用自顶向下的方法,

2013-08-24 14:37:14 394 1

空空如也

空空如也

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

TA关注的人

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