摘要: #include<iostream>#include<stack>using namespace std;const int MaxSize=100;int gcd(int a,int b){ int c; while(a%b!=0) { c=a%b; a=b; b=c; } return b;}int main(){ stack<int>S,Q; int num,i; cout<<"请输入有多少个数:"; cin>>num; int number[MaxSize]; for(i=0;i<num;i++) { 阅读全文
posted @ 2012-11-22 22:50 ♂咱說 ろ算 阅读(233) 评论(0) 推荐(0) 编辑
摘要: //utility.h#ifndef __UTILITY_H__ // 如果没有定义__UTILITY_H__#define __UTILITY_H__ // 那么定义__UTILITY_H__// 实用程序工具包#ifdef _MSC_VER // 表示是Visual C++#if _MSC_VER == 1200 // 表示Visual C++6.0// 标准库头文件#include <string.h> // 标准串和操作#include <iostream.h> // 标准流操作#include <limits.h> // 极限#include &l 阅读全文
posted @ 2012-10-07 22:48 ♂咱說 ろ算 阅读(297) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>#include<string>using namespace std;#define LIST_INIT_SIZE 100#define LISTINCREMENT 10typedef int Status,ElemType;typedef struct{ ElemType *elem; int length; int listsize;}SqList;void Init_Sq(SqList &L){ L.elem=new ElemType[LIST_INIT_SIZE]; if(L.elem==NULL) exit(1); 阅读全文
posted @ 2012-09-26 23:14 ♂咱說 ろ算 阅读(209) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef int ElemType;typedef struct List{ ElemType data; struct List *next;}LinkNode,*LinkList;LinkNode *creat_List(int number){ LinkList first=new LinkNode; first->data=-1; LinkList p=first; if(first==NULL) { cout<<"分配内存失败"<<endl; 阅读全文
posted @ 2012-09-26 23:13 ♂咱說 ろ算 阅读(259) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef int ElemType;typedef struct Node{ ElemType data; Node *next,*prior;}LinkNode,*LinkList;void creat_List(LinkList&L,int length){ LinkNode *p,*first=L; while(length-->0) { p=new LinkNode; cin>>p->data; L->next=p; p->prior=L; L=p; 阅读全文
posted @ 2012-09-26 23:12 ♂咱說 ろ算 阅读(153) 评论(0) 推荐(0) 编辑
摘要: #include<iostream>using namespace std;typedef int ElemType ;typedef struct node{ElemType data;struct node *next;}LinkNode,*LinkList;void creat(LinkList&first,LinkNode*&last,int endTage)//递归尾插法建立链表{ElemType data;cout<<"请建立数据"<<endl;cin>>data;if(endTage==data) 阅读全文
posted @ 2012-09-26 23:10 ♂咱說 ろ算 阅读(240) 评论(0) 推荐(0) 编辑
摘要: package MONTH;import javax.swing.*;public class month {private int year;private int month;private String []every_month={"January","February","March","April","May","June","July","August","September","Octobe 阅读全文
posted @ 2012-09-23 01:13 ♂咱說 ろ算 阅读(353) 评论(0) 推荐(0) 编辑
摘要: #include<fstream>#include<iostream>#include <algorithm>sort#include<string>#include<iomanip>using namespace std;class data{public: void input(); int num; char name[10]; char sex; float score[4]; float sum_score; float ave_score;};void data::input(){ cout<<"学号 阅读全文
posted @ 2012-09-21 16:37 ♂咱說 ろ算 阅读(217) 评论(0) 推荐(0) 编辑
摘要: #include<fstream>#include"conio.h"#include<string>#include<iostream>#include<iomanip>using namespace std;struct date{ int year; int month; int day;};struct time{ int hour; int minute; int sec;};struct Route{ char number[10];//车次 char begin_place[10];//始发点 char end_p 阅读全文
posted @ 2012-09-21 16:35 ♂咱說 ろ算 阅读(397) 评论(0) 推荐(0) 编辑
摘要: import javax.swing.*;public class xin{ public static void main(String[] args) { String year1=JOptionPane.showInputDialog("Enter a year"); int year=Integer.parseInt(year1); String day1=JOptionPane.showInputDialog("Today is"); int day=Integer.parseInt(day1); int []month_day={31,28, 阅读全文
posted @ 2012-09-21 16:04 ♂咱說 ろ算 阅读(414) 评论(0) 推荐(0) 编辑