摘要:#include<stdio.h> #include<math.h> using namespace std; int main(){ int c1,c2,h,m,s; int c; scanf("%d %d",&c1,&c2); c = (c2-c1); h = c / (3600*100); m
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 const int maxn = 100000; 6 char a[maxn]; 7 int main(){ 8 int e
阅读全文
摘要:1 #include<stdio.h> 2 #include<algorithm> 3 #include<string.h> 4 using namespace std; 5 const int maxn = 50; 6 int main(){ 7 int a[10],count=0,value;
阅读全文
摘要:1 #include<stdio.h> 2 #include<algorithm> 3 using namespace std; 4 const int MAXN=1001; 5 struct kind{ 6 double num,price,p_price; 7 }; 8 int d,n; 9 s
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 using namespace std; 5 char n[5]; 6 bool cmp(char a,char b){//降序 7 return a>b; 8 } 9
阅读全文
摘要:1 #include<stdio.h> 2 3 // c:0 j:1 b:2 0:胜 1:平 2:负 4 int n,p1[3],p2[3],num[3]; 5 6 void read(); 7 void deal(int x,int y); 8 int change(char a); 9 char
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 const int MAXN=1001; 5 char a[MAXN]; 6 int b; 7 int q[MAXN],r[MAXN]; 8 void read(); 9
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 const int MAXN=13; 5 char a[MAXN],b[MAXN]; 6 char da,db; 7 void read(); 8 long long in
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 using namespace std; 4 const int MAXN = 65; 5 char a[MAXN],b[MAXN]; 6 int main(){ 7 int day,h,m,count=0,len=0
阅读全文
摘要:1 #include<cstdio> 2 #include<cmath> 3 using namespace std; 4 5 const int MAXN = 100000000; 6 int a[MAXN]; 7 bool isprime(int x); 8 int main(){ 9 int
阅读全文
摘要:1 #include<cstdio> 2 using namespace std; 3 int num[5],sumn[5],n; 4 void init(); 5 void read(); 6 void deal(); 7 int main(){ 8 init(); 9 read(); 10 de
阅读全文
摘要:1 #include<cstdio> 2 using namespace std; 3 int t; 4 int main(){ 5 long long int a,b,c; 6 scanf("%d",&t); 7 for(int i=1;i<=t;i++){ 8 scanf("%lld %lld
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 100000 3 struct poly{ 4 int exp,var; 5 }; 6 struct poly a[MAXN]; 7 void read(); 8 void deal(); 9 void print(); 10 i
阅读全文
摘要:提交后最后一项本来不通过,但是更改条件后(见注释)结果就成功了,可见不一定单词里边只有A-Z,a-z,还有其他的内容。 1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 100 4 char a[MAXN]; 5 int main(){
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 102 3 int n,a[MAXN],m; 4 int main(){ 5 scanf("%d %d",&n,&m); 6 int i,j; 7 for(i=0;i<n;i++) scanf("%d",&a[i]); 8 if(
阅读全文
摘要:#include<stdio.h> #define MAXN 102 int A[MAXN],a[MAXN],p[MAXN],n; void read(); void init(int a[]); int test(int a[],int b[]); int insertion_sort(int a
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 102 3 int n,a[MAXN],p[MAXN],A[MAXN]; 4 void read(); 5 int insertion_sort(); 6 void merge_sort(); 7 void merge_pass(
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 101 4 int find(char a[],char c); 5 int test(char a[]); 6 int main(){ 7 int n,i; 8 char a[MAXN]
阅读全文
摘要:读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。 1 #include<stdio.h> 2 int main(){ 3 char c; 4 int sumt=0,t[10],count,i; 5 scanf("%c",&c); 6 while(c!='\0'&&c!='\n'
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 1001 4 struct node{ 5 int data,left,right,parent; 6 node(){ 7 data = -1; 8 left = -1; 9 right=
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXK 1000000 3 int a[MAXK],dp[MAXK],k; 4 int main(){ 5 int i,maxsum; 6 scanf("%d",&k); 7 for(i=0;i<k;i++){ 8 scanf("%d",
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXK 10001 3 int k,a[MAXK],dp[MAXK],start[MAXK],end[MAXK]; 4 int main(){ 5 int i,j; 6 scanf("%d",&k); 7 for(i=0;i<k;i++)
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 101 4 struct edge{ 5 int v,e,l,time; 6 }; 7 struct adjs{ 8 struct edge ed[MAXN]; 9 struct edge
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 100 4 #define INF 0x3fffffff 5 int n,m,g[MAXN][MAXN],indegree[MAXN],ve[MAXN]; 6 void read(); 7
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 1001 4 #define INF 0x3fffffff 5 int n,m,g[MAXN][MAXN],vis[MAXN],dist[MAXN]; 6 void read(); 7 i
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 502 4 #define INF 0x3fffffff 5 int n,m,s,d; 6 int g[MAXN][MAXN],vis[MAXN],weight[MAXN][MAXN],d
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 101 4 #define INF 0x3fffffff 5 6 int g[MAXN][MAXN],n,m,dist[MAXN],result[MAXN],vis[MAXN]; 7 vo
阅读全文
摘要:1 #include<stdio.h> 2 #include<string.h> 3 #define MAXN 1004 4 int g[MAXN][MAXN]; 5 int n,m; 6 int queue[MAXN*10000],front,rear; 7 void read(); 8 void
阅读全文
摘要:1 #include<stdio.h> 2 #include<math.h> 3 #define MAXN 102 4 #define INF 1000000000 5 struct pos{ 6 int x,y; 7 }; 8 struct edge{ 9 int v1,v2; 10 }; 11
阅读全文
摘要:1 #include<stdio.h> 2 #include<math.h> 3 #define MAXN 102 4 struct pos{ 5 int x,y; 6 }; 7 struct pos p[MAXN]; 8 int n,d,flag; 9 int g[MAXN][MAXN],vis[
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 10 3 int g[MAXN][MAXN],vis[MAXN],n,e; 4 void init(); 5 void read(); 6 void BFS(int x); 7 void DFS(int x); 8 int mai
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 10001 3 int a[MAXN],root[MAXN]; 4 int getfather(int x); 5 int main(){ 6 int i,a1,a2,fa1,fa2,ch; 7 char op; 8 scanf(
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 1002 3 int H[MAXN],N,M,r[MAXN]; 4 void inserth(int data); 5 void read(); 6 void printr(); 7 int main(){ 8 read(); 9
阅读全文
摘要:测试根据不同的输入顺序是否为同一棵二叉搜索树。其中树的结点数小于等于10,而且树的数字为1-n。 1 #include<stdio.h> 2 #define MAXN 11 3 struct node{ 4 int left,right; 5 }; 6 struct node A[MAXN],B[M
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 1001 3 int n,a[MAXN],b[MAXN],c[10]; 4 void read(); 5 void sort(); 6 void cbt(int len,int pos,int start); 7 int main
阅读全文
摘要:1 #include<stdio.h> 2 #include<math.h> 3 #define MAXN 1000 4 struct node{ 5 int left,right,data,height,parent; 6 }; 7 struct node a[MAXN]; 8 int n; 9
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 31 3 int a[MAXN],n,flag[MAXN]; 4 void deal(); 5 int main(){ 6 scanf("%d",&n); 7 a[0] = n; 8 flag[0] = n; 9 deal();
阅读全文
摘要:1 #include<stdio.h> 2 #define MAXN 10 3 struct node{ 4 int left,right; 5 }; 6 struct node a[MAXN]; 7 int n,leavesnum,r; 8 void showleave(); 9 void rea
阅读全文
摘要:1 #include<stdio.h> 2 struct node{ 3 char data; 4 int left,right; 5 }; 6 struct node a[11],b[11]; 7 int Na,Nb,ra,rb,flag; 8 int read(struct node a[],i
阅读全文
摘要:刚开始拿到这道题的时候错误的做法: 1 //相邻之间的数小于等于M 2 //首先弹出来的数小于等于M 3 #include<stdio.h> 4 #include<math.h> 5 #define MAXN = 1000000; 6 int M,N,K; 7 int main(){ 8 int p
阅读全文