精華區beta NTUCH-HW 關於我們 聯絡資訊
功能 用到的觀念 CODE /*PROGRAMMER :楊翔斌*/ /*DATE :2009-12-24*/ /*FILENAME :compare.h*/ /*DESCRIPTION:compare the number of cards*/ #include "stdafx.h" #include"iostream" #include "consola.h" //#include "shuffle.h" using namespace std; #include "ctime" using std::time; class compare { public: void findmax(int,int,int,int); }; void compare::findmax(int sumn,int sums,int sume,int sumw) { int max1,max2,max3; max1=max(sumn,sums); max2=max(max1,sumw); max3=max(max2,sume); if(max3==sumn) cout<<"north has the greatest number total"<<endl; else if(max3==sume) cout<<"east has the greatest number total"<<endl; else if(max3==sumw) cout<<"west has the greatest number total"<<endl; else if(max3==sums) cout<<"west has the greatest number total"<<endl; } -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.7.59