![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
月护王
这个作者很懒,什么都没留下…
展开
-
进来看一下
进来看下,知道的解答一下,实在是不明白.....听君一席话,胜读十年书!!!#include#includeusing namespace std;string fun1(const string &s1,const string &s2);const string &fun2(string &s1,const string &s2);const string原创 2012-12-24 21:25:01 · 590 阅读 · 0 评论 -
有没有更简单的算法
(cc)^2+(ab)^2=abcc#includeusing namespace std;int main(){system ("color e");int n,a,b,c,p,q;for(n=1001;n{a=n/1000;b=n%1000/100;c=n%10;p=11*c;q=(10*a+b);if(n==(p*p+q*q))co原创 2012-12-25 21:10:42 · 622 阅读 · 0 评论 -
模板函数
下面的代码不管是在VC6.0还是在VC2010上都是不通过,为什么啊,知道的说下:听君一席话,胜读十年书#includeusing namespace std;template void swap(T &a,T &b);struct KT{char name[40];double xinshui;int floor;};tem原创 2012-12-26 20:36:32 · 539 阅读 · 0 评论 -
随机数,和,平均值
#include#include#includeGetRandNumber(int *a,int n,int s,int e){int i,j;std::set m;std::set::iterator setpos;srand(time(NULL));while(m.size(){j=rand()%(e-s)+s;m.insert(j);}原创 2012-12-28 16:36:59 · 1145 阅读 · 0 评论 -
vs 2010旗舰版问题
在VS2010学习版中这个可以运行!为啥在VS2010旗舰版中运行不了啊!错误提示在下面[code]#includeusing namespace std;template void jhuan(T &a,T &b);struct KT{char name[40];double xinshui;int floor;};templa原创 2012-12-29 04:14:22 · 703 阅读 · 0 评论 -
这次又是为什么
#includeusing namespace std;double swapr(double &a);double swapp(double *q);double swapv(double a);int main(){system ("color e");double a;coutcin>>a;//coutcoutcoutcoutcou原创 2012-12-22 20:08:17 · 589 阅读 · 0 评论 -
蛇形排列
#include #include #define N 11int main(){ using namespace std; system("color e"); int i,j,a[N][N]={0}; for(i=0;i<N;i++) { for(j=0;j<N;j++) if(i%2==0) a[i][j]+=N*i+j+1; else a[原创 2013-09-24 17:59:04 · 1332 阅读 · 0 评论