- 博客(46)
- 收藏
- 关注
原创 81------90
81public class test { public static void main(String[] args){ //以下是输入整个数组 int n; int array[]; System.out.println("请输入整数的个数"); Scanner keyboard=new Scanner(System.in); n=keyboard.nextInt(); array =...
2021-09-13 15:38:45
108
原创 76-----80
76.#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>/* 题目:八进制转换为十进制 八进制456 =》 十进制 302 302 = 6*pow(8,0)+5*pow(8,1)+4*pow(8,2)*/int main07(){ int n;...
2021-08-23 10:55:26
159
原创 71----75
71.#include "stdio.h"#include "math.h"int main(void){ int x = -100; double y = 0, z = 0; // y+,z+,0<(z+y)<168,0<(z-y)<168 do { y = sqrt(x + 100); z = sqrt(x + 100 + 168); if (y == (int)y &&...
2021-08-21 10:13:36
124
原创 66------70
66.#include <stdio.h>long get_file_size(char *file_name){ FILE *fp = NULL; if((fp = fopen(file_name,"r")) == NULL){ printf("获取文件失败"); return -1; } //从文件末尾偏移,偏移0位 fseek(fp,0,SEEK_END); long file_size = ftell(fp...
2021-08-18 09:15:19
150
原创 61-----65
61.#include <stdio.h>#include <stdlib.h>int main(){ FILE* fp; char ch, filename[10]; printf("please enter file name:"); scanf("%s", filename); if ((fp = fopen(filename, "w")) == NULL) { printf("error"); ...
2021-08-17 08:40:17
85
原创 56-----60
56.不会做57.#include <stdio.h>void average(float *p,int n){int i=0;float *p_end,sum=0,ave;p_end=p+n;for (;p<p_end;p++,i++){ printf("%d=%.0f ",i,*p); sum+=(*p);}printf("\n\n");ave=sum/n;printf("总分数:%.2f\n",ave);}void ...
2021-08-08 09:41:54
77
原创 51-----55
51.#include<stdio.h>#include<stdlib.h>#define LEN sizeof(struct Student)struct Student{ long num; float score; struct Student *next;};int n;struct Student *creat(void){ struct Student *head; struct Student *p1,...
2021-08-05 11:05:14
89
原创 46----50
46.#include <stdio.h>#include <math.h>#include <string.h>int main( ){ void hexadecimal_to_decimalism(char hexadecimal[]); char hexadecimal[100]; printf("请输入一个十六进制数:"); gets(hexadecimal); hexadecimal_to_decimalism(hexadec...
2021-07-27 09:32:41
72
原创 41-----45
41.#include<stdio.h>void main(){int a,n,s=0;printf(“Input a: “);scanf(”%d”,&a);printf(“Input n:”);scanf("%d",&n);while(n>=0){s=an+s;a=a10;n–;}printf(“s= %d\n”,s);}42.#include<stdio.h>int main(){ void sort(int...
2021-07-27 09:28:44
73
原创 二级题库29.
1.#include <stdio.h>#define N 100void fun( int *a , int n ){ int i, t; for( i=0; i<n; i++ )/**********found**********/ a[i]=0; i=0;/**********found**********/ t=1; while( i<n ) { a[i]= 1; t++;/***...
2021-07-21 09:00:06
63
原创 二级题库28.
1.#include <stdio.h>typedef struct list{ char data; struct list *next;} Q;void fun( Q *pa, Q *pb, Q *pc){ Q *p;/**********found**********/ pa->next=pb0; pb->next=pc; p=pa; while( p ) {/**********found**********/...
2021-07-20 08:38:52
112
原创 二级题库27.
1.#include <stdio.h>#include <stdlib.h>void fun( int *a, int n ){ int i; for(i=0; i<n; i++) {/**********found**********/ if( i%5==0 )/**********found**********/ printf("\n");/**********found**********/ ...
2021-07-20 08:25:10
174
原创 二级题库26.
#include <stdio.h>#define N 9int fun(int x[]){ int i,j,k,t,mid,b[N]; for(i=0;i<N;i++) b[i]=x[i]; for(i=0;i<=N/2;i++) { k=i; for(j=i+1;j<N;j++) if(b[k]>b[j]) k=j; if(k != i ) { /**********found**...
2021-07-19 09:12:18
175
原创 二级题库25.
1.#include <stdio.h>#define N 5typedef struct student { long sno; char name[10]; float score[3];} STU;void fun(char *filename){ FILE *fp; int i, j; STU s[N], t;/**********found**********/ fp = fopen(filename, "rb");...
2021-07-19 09:02:15
125
原创 二级题库24.
1.#include <stdio.h>double f1(double x){ return x*x; }double f2(double x, double y){ return x*y; }/**********found**********/__1__ fun(int i, double x, double y){ if (i==1)/**********found**********/ return __2__(x); else/*...
2021-07-18 08:18:47
183
原创 二级题库23.
1.#include <stdio.h>#include <string.h>#define N 5#define M 8void fun(char (*ss)[M]){ char *ps[N],*tp; int i,j,k; for(i=0; i<N; i++) ps[i]=ss[i]; for(i=0; i<N-1; i++) {/**********found**********/ k=i; f...
2021-07-18 08:17:40
228
原创 二级题库22.
1.#include <stdio.h>#include <string.h>#include <ctype.h>void fun(char *s){ int k[26]={0},n,i,max=0; char ch; while(*s) { if( isalpha(*s) ) {/**********found**********/ ch=tolower(*s); n=ch-'a';/**********fo...
2021-07-17 09:15:23
152
原创 二级题库21.
1.#include <stdio.h>#include <string.h>#include <ctype.h>int fun(char *s){ int sum=0; while(*s) {/**********found**********/ if( isdigit(*s) ) sum+= *s- 48 ;/**********found**********/ s++; }/**********found******...
2021-07-17 09:07:56
214
原创 36---40
36.#include <stdio.h>int main(){ void count(char *p); char str[100], *p=str; printf("请随便输入一个字符串:"); gets(p); printf("您输入的字符串为:\n%s\n\n", p); count(p); return 0;}void count(char *p){ int u,l,s,n,o; u=l=s=n...
2021-07-15 08:55:21
82
原创 31----35
31.#include<stdio.h>#include<stdlib.h>#pragma warning(disable:4996)int main(){ void *input(int *p,int n); int array[10]; int n = sizeof(array)/4; printf("n的值是%d\n", n); input(array,n); printf("数组从大到小排序后:\n"); for ...
2021-07-14 08:47:28
60
原创 二级题库20.
1.#include <stdio.h>int fun(char *s, char *t){ int n=0; while(*s) { if(*s < 97) {/**********found**********/ *(t+n)= *s ; n++; }/**********found**********/ s++ ; } *(t+n)=0;/**********found**********/ return n;}vo...
2021-07-13 08:59:43
146
原创 二级题库19.
1.#include <stdio.h>int fun(char *s){ int n=0, flag=0; while(*s!='\0') { if(*s!=' ' && flag==0) {/**********found**********/ n++; flag=1;}/**********found**********/ if (*s==' ') flag= 0 ;/**********found**********/ ...
2021-07-13 08:57:14
196
原创 二级题库18.
1.#include <stdio.h>#include <string.h>#include <ctype.h>int fun(char *s){ char *lp,*rp;/**********found**********/ lp=s; rp=s+strlen(s)-1; while((toupper(*lp)==toupper(*rp)) && (lp<rp) ) {/**********found***...
2021-07-12 08:56:22
38
原创 二级题库17.
1.#include <stdio.h>#include <string.h>#define N 80void fun(char *s, int n, char *t){ int len,i,j=0; len=strlen(s);/**********found**********/ if(n>=len) strcpy(t,s); else {/**********found**********/ for(i=len-n; i...
2021-07-12 08:39:38
190
原创 二级题库16.
1.#include <stdio.h>#define M 3#define N 4void fun(int (*a)[N]){ int i=0,j,find=0,rmax,c,k; while( (i<M) && (!find)) { rmax=a[i][0]; c=0; for(j=1; j<N; j++) if(rmax<a[i][j]) {/**********found********...
2021-07-10 08:38:14
69
原创 二级题库15.
1.#include <stdio.h>#define M 3#define N 5void fun(int (*a)[N],int k){ int i,j,p,temp;/**********found**********/ for(p=1; p<=k; p++) for(i=0; i<M; i++) { temp=a[i][0];/**********found**********/ for(j=0;...
2021-07-10 08:12:43
175
原创 二级题库14.
1.#include <stdio.h>#define N 3#define M 4/**********found**********/void fun(int (*a)[N], intk){ int i,temp ;/**********found**********/ for(i = 0 ; i < N ; i++) { temp=a[0][i] ;/**********found**********/ a[0][i] = a[k][...
2021-07-09 08:33:01
208
原创 二级题库13.
1.#include <stdio.h>#include <string.h>#include <stdlib.h>#include <ctype.h>char *fun(char *s){ int i, j, k, n; char *p, *t; n=strlen(s)+1; t=(char*)malloc(n*sizeof(char)); p=(char*)malloc(n*sizeof(char)); j=0...
2021-07-09 08:21:44
71
原创 二级题库12.
1.#include <stdio.h>#include <stdlib.h>#define N 6typedef struct node { int data; struct node *next;} NODE;void fun(NODE *h){ NODE *p, *q; int t;/**********found**********/ p =h->next; while (p) {/**********f...
2021-07-08 08:57:26
144
原创 二级题库11.
1.#include <stdio.h>double f1(double x){ return x*x; }double f2(double x, double y){ return x*y; }double fun(double a, double b){/**********found**********/ double(*f)(); double r1, r2;/**********found**********/ f =fl ; r...
2021-07-08 08:49:46
175
原创 26-----30
26.#include <stdio.h>#include <math.h>int prime(int n){ int i; long k; k = sqrt(n) + 1; for (i = 2; i <= k; i++) if (n%i == 0) return 0; return 1;}int main(){ int mp, n = 0, i; printf...
2021-07-07 08:30:46
65
原创 二级题库10.
1.#include <stdio.h>#define N 3int fun(int (*a)[N]){ int i,j,m1,m2,row,colum; m1=m2=0; for(i=0; i<N; i++) { j=N-i-1; m1+=a[i][i]; m2+=a[i][j]; } if(m1!=m2) return 0; for(i=0; i<N; i++) {/**********found**********/ ...
2021-07-05 08:59:45
85
原创 二级题库9.
1.#include <stdio.h>#define N 7/**********found**********/void fun(int (*a)[N] if(N%2==0) m=N/2 ; else m=N/2+1; for(i=0; i<m; i++) {/**********found**********/ for(j=i; j<N-i; j++) a[i][j]=a[N-i-1][j]=i+1; ...
2021-07-05 08:57:01
336
原创 二级题库8.
1.#include <stdio.h>#define N 4void fun(int (*a)[N], int *b){ int i,j; for(i=0; i<N; i++) {/**********found**********/ b[i]=a[0][i]; for(j=1; j<N; j++)/**********found**********/ if(b[i]<a[j][i]) b[i]...
2021-07-05 08:48:10
79
原创 二级题库7.
1.#include <stdlib.h>#include <stdio.h>#define N 20void fun( int *a){ int i, x, n=0; x=rand()%20;/**********found**********/ while (n<N) { for(i=0; i<n; i++ )/**********found**********/ if( x==a[i] ) ...
2021-07-04 17:09:13
101
原创 二级题库6.
1.#include <stdio.h>#include <string.h>#include <ctype.h>#define N 9long ctod( char *s ){ long d=0; while(*s) if(isdigit( *s)) {/**********found**********/ d=d*10+*s-‘0’;/**********found**********/ s++; ...
2021-07-04 16:36:55
75
原创 二级题库5.
1.#include <stdlib.h>#include <stdio.h>#define N 10double fun(double *x){ int i, j; double av, y[N]; av=0; for(i=0; i<N; i++)/**********found**********/ av+=x[i]/N; for(i=j=0; i<N; i++) if( x[i]<av ){...
2021-07-03 08:11:51
111
原创 二级题库4.
1.#include <stdlib.h>#include <stdio.h>#define N 10double fun(double *x){ int i, j; double s, av, y[N]; s=0; for(i=0; i<N; i++) s=s+x[i];/**********found**********/ av=s/N; for(i=j=0; i<N; i++) if( x[i]>av...
2021-07-03 08:01:40
399
原创 二级题库3.
1.#include <stdlib.h>#include <stdio.h>#define N 10double fun(double x[],double *av){ int i,j; double d,s; s=0; for(i=0; i<N; i++) s = s +x[i];/**********found**********/ *av=s/N; d=32767; for(i=0; i<N; i++)...
2021-07-03 07:40:00
172
原创 二级题库2.
1.#include <stdlib.h>#include <stdio.h>#define N 10double fun(double x[],double *y){ int i,j; double av;/**********found**********/ av=0.0;/**********found**********/ for(i=0; i<N; i++) av=av+x[i]/N; for(i=j=0;...
2021-07-03 07:32:48
181
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人