摘要:
用选择法法对数组中的10个整数按由小到大排序。#include using namespace std;int main(){ void select_sort(int arrary[],int n); //函数声明 int a[10],i; cout>a... 阅读全文
摘要:
#include #define MAXN 100int a[MAXN];int f(int m, int k){ int i,j; for(i = m; i >= k; i--) { a[k] = i; if(k > 1) f(i-1... 阅读全文
摘要:
#include #include #define N 100010int a[N]; //存放数字t出现的次数int main(){ int m,n,i,t,p,ans; scanf("%d",&m); while(m--) { ans=0; ... 阅读全文
摘要:
多项式求和Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 42627 Accepted Submission(s): 24909Problem D... 阅读全文
摘要:
#include#include#include#includeusing namespace std ;int main(){ int i,j,n,m,pj,py,t,s,max,sum; char gb,xb; string name1,name; scanf("%d",&m); get... 阅读全文
摘要:
近来刚学JAVA,就从JAVA写起吧,JAVA判别素数,其实方法和C/C++没什么区别,主要就是想谈一下,其中包括的3个点。(1)JAVA语言产生随机数,random函数,定义参数max的作用是给出最大随机数的生成范围,当然也可以产生一组随机数,定义数组mat[],在random中定义int n,... 阅读全文
摘要:
#includeint main(){int m,n;double s,y,i,j,k;while(scanf("%d",&m)!=EOF){for(i=0;i<m;i++){s=0.0;k=1;scanf("%d",&n);for(j=1;j<=n;j++){y=k/j;s+=y;k=-k;}pr... 阅读全文
摘要:
#include int main(){ int a,b=0,c,y,m,d,fib; scanf("%d",&a); while(a--) { scanf("%d %d %d",&y,&m,&d); if(y%400==0||y%100!=0&&y%4==0) fib=29; else ... 阅读全文
摘要:
确定比赛名次Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10440Accepted Submission(s): 4083Pro... 阅读全文
摘要:
#include;using namespace std;int main(){int a,b;cin>>a>>b;cout 阅读全文