随笔分类 - pat乙级
1
摘要:一定要注意strlen函数的正确使用 在已经明确定义char大小时,strlen将给出已定大小,而不是截止到'\0' 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <math.h> 5 #inc
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <math.h> 5 6 int main() 7 { 8 int n; 9 scanf("%d", &n); 10 char id[n][19];
阅读全文
摘要:关键是qsort函数和滑动窗口 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <math.h> 5 int max(int a, int b) 6 { 7 return a > b ? a :
阅读全文
摘要:1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 #include<math.h> 5 6 int main() 7 { 8 char ch1[81],ch2[81]; 9 scanf("%s",ch1); 10 scan
阅读全文
摘要:1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <math.h> 5 6 typedef struct people 7 { 8 char name[6]; 9 int year; 10 int
阅读全文
摘要:ac 但写得就像坨答辩 过两天我自己都忘了这些变量用来干嘛的了 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <string.h> 4 #include <math.h> 5 6 int main() 7 { 8 int num[1000
阅读全文
摘要:1 #include <stdio.h> 2 3 int main(){ 4 int c1,c2; 5 scanf("%d%d",&c1,&c2); 6 int ans = c2-c1; 7 8 if(ans%100>=50){ 9 ans=ans/100+1; 10 }else{ 11 ans =
阅读全文
摘要:目前无法ac过最后一个测试点,其余ac,原因是有无效节点存在,但这个代码加上去除无效节点函数时便会运行超时 还没想出来怎么做,先这样吧 #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> typed
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { int a[10]; for (int i = 0; i < 10; i++) { scanf("%d", &a[i])
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> #define N 100 int main() { int a,b,d; scanf("%d %d %d",&a,&b,&d); int num[N];
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> #define k 1000 int main() { int i = 0; char num[k]; for (i = 0; i < k; i+
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> typedef struct { double st; double mo; double q; } cake; int main() { int
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> void decline(int a[]) { int temp = 0; for (int i = 0; i < 3; i++) { for (
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int max(int a,int b){ return a>b?a:b; } int main() { int n; scanf("%d",&n); g
阅读全文
摘要:#include <stdio.h> #define MAX_A 1000 int A[MAX_A]; int B; /* 除数 */ int num; /* A 被除数有多少位 */ void read_AB(); void division_print(); /*****************
阅读全文
摘要:#include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> int main() { int counta = 0, countb = 0; int pa=0,pb=0; char a[10], b[10]
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int min(int a,int b); int min(int a,int b){ return a<b?a:b; } int main() { ch
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { int t; scanf("%d",&t); long long a,b,c; int i=1; while(i<=t){ sc
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { int n; int a1=0,a2=0,a3=0,a5=0; double a4=0; int i=0; int flag=1
阅读全文
摘要:#include<stdio.h> #include<stdlib.h> #include<string.h> #include<math.h> int main() { int num[10000]={0}; num[0]=2; int flag=0; int count=0; int a,b;
阅读全文
1

浙公网安备 33010602011771号