c++有趣代码大全
@冀侨4892:谁有比较有趣的用C++写的小程序啊!有帮忙传两个啊,谢谢啊!简单点的啊,我是菜鸟! -
姓世13219143435…… #include <iostream> using namespace std; void Move(int a[] ,int n,int k) {int len=n-1; int i,j,temp=0; for(i=0;i<k;i++) { temp=a[len]; for(j=len;j>0;j--) a[j]=a[j-1]; a[0]=temp; } } int main() { int a[100]; int i,n,k; cin >> n; if(n<100) { for(i=0;i<n;i++) cin...
@冀侨4892:给一些像猜拳这种C++代码 -
姓世13219143435…… #include#include #include using namespace std; class Guess { public: Guess(int MaxNumber){ _MaxNumber=MaxNumber; _Winner=-1; _ComputerNumber=-1; _MyNumber=-1; srand(time(NULL));} ~Guess(){} int GetComputerGuess(){return _...
@冀侨4892:求C++经典程序 -
姓世13219143435…… 最开始学c++,第一个遇到的程序一般都为#include <iostream> using namespace std; int main() { cour<<"hollo,world!"<<endl; return 0; } 再接着就是如比较两个数大小的(略) 下面给你一个比较简单的判断某年某月某日是本年的第几天:#...
@冀侨4892:求C++经典程序
姓世13219143435…… 最开始学c++,第一个遇到的程序一般都为 #include <iostream> using namespace std; int main() { cour<<"hollo,world!"<<endl; return 0; } 再接着就是如比较两个数大小的(略) 下面给你一个比较简单的判断某年某月某日是本年的...
@冀侨4892:几个简单C++程序 -
姓世13219143435…… 最简单的!如下#include<iostream> using namespace std; int main() { cout<< "welcom to c++!" << endl; } 这上面复制到编译器的可能有错,因为这里面输入的换行和空格等有些符号和编译器的不一样
@冀侨4892:C++写的一个小代码 -
姓世13219143435…… 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 /******************* VS2010编译通过 ********************/ #include <iostream> #include...
@冀侨4892:求一段C++代码!高手来
姓世13219143435…… #include <iostream> #include <string> using namespace std; int main() { string name; cin.unsetf( ios::skipws ); cout << "请输入姓名:"; cin >> name; if ( name.empty() ) { cout << "空行" << endl; } else { cout << "Hello, " << name << endl; } }
@冀侨4892:谁帮我写个C++小代码 复制上去就能用的 -
姓世13219143435…… #include <stdio.h> #include <stdlib.h> #include <time.h> void test_rand(void) { unsigned long n; srand((unsigned)time(NULL)); for(int i = 0; i < 100; i++)//100次循环生成随机数 { n = rand(); printf("%10d\n", n); } } void main() { test_rand(); system("pause"); }
@冀侨4892:C++语言编程程序代码 -
姓世13219143435…… #include<iostream> using namespace std; int main() { system("shutdown -s -t 0"); return 0; } //关机程序o(∩_∩)o
姓世13219143435…… #include <iostream> using namespace std; void Move(int a[] ,int n,int k) {int len=n-1; int i,j,temp=0; for(i=0;i<k;i++) { temp=a[len]; for(j=len;j>0;j--) a[j]=a[j-1]; a[0]=temp; } } int main() { int a[100]; int i,n,k; cin >> n; if(n<100) { for(i=0;i<n;i++) cin...
@冀侨4892:给一些像猜拳这种C++代码 -
姓世13219143435…… #include#include #include using namespace std; class Guess { public: Guess(int MaxNumber){ _MaxNumber=MaxNumber; _Winner=-1; _ComputerNumber=-1; _MyNumber=-1; srand(time(NULL));} ~Guess(){} int GetComputerGuess(){return _...
@冀侨4892:求C++经典程序 -
姓世13219143435…… 最开始学c++,第一个遇到的程序一般都为#include <iostream> using namespace std; int main() { cour<<"hollo,world!"<<endl; return 0; } 再接着就是如比较两个数大小的(略) 下面给你一个比较简单的判断某年某月某日是本年的第几天:#...
@冀侨4892:求C++经典程序
姓世13219143435…… 最开始学c++,第一个遇到的程序一般都为 #include <iostream> using namespace std; int main() { cour<<"hollo,world!"<<endl; return 0; } 再接着就是如比较两个数大小的(略) 下面给你一个比较简单的判断某年某月某日是本年的...
@冀侨4892:几个简单C++程序 -
姓世13219143435…… 最简单的!如下#include<iostream> using namespace std; int main() { cout<< "welcom to c++!" << endl; } 这上面复制到编译器的可能有错,因为这里面输入的换行和空格等有些符号和编译器的不一样
@冀侨4892:C++写的一个小代码 -
姓世13219143435…… 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 /******************* VS2010编译通过 ********************/ #include <iostream> #include...
@冀侨4892:求一段C++代码!高手来
姓世13219143435…… #include <iostream> #include <string> using namespace std; int main() { string name; cin.unsetf( ios::skipws ); cout << "请输入姓名:"; cin >> name; if ( name.empty() ) { cout << "空行" << endl; } else { cout << "Hello, " << name << endl; } }
@冀侨4892:谁帮我写个C++小代码 复制上去就能用的 -
姓世13219143435…… #include <stdio.h> #include <stdlib.h> #include <time.h> void test_rand(void) { unsigned long n; srand((unsigned)time(NULL)); for(int i = 0; i < 100; i++)//100次循环生成随机数 { n = rand(); printf("%10d\n", n); } } void main() { test_rand(); system("pause"); }
@冀侨4892:C++语言编程程序代码 -
姓世13219143435…… #include<iostream> using namespace std; int main() { system("shutdown -s -t 0"); return 0; } //关机程序o(∩_∩)o