current position:Home>There has always been error printf_ The one function does not accept one parameter, 126 rows and columns, 142 rows and columns, and error printf_ Sum function does not accept one parameter, 128 rows and 144 rows and columns. What should I do

There has always been error printf_ The one function does not accept one parameter, 126 rows and columns, 142 rows and columns, and error printf_ Sum function does not accept one parameter, 128 rows and 144 rows and columns. What should I do

2022-01-27 02:56:31 CSDN Q & A

#include "stdafx.h"
#include<stdlib.h>
#include<string.h>
#define A 100
int y=0,f=0,j,W,M,N,p[15],q[15];
struct student
{char shool[20];
char name[20];
char item[20];
char sex;
int mingci;
int mark;
}stu[A];
struct item
{char name[20];
char sex;
int mark;
}it[A];
struct shool
{ char name[20];
char item[20];
int mark;
} sho[A];
void main()
{void menu();
menu();
}
void menu ()
{
void establish(),enter(),search();
int wl,n;
do{
puts("\t\tMENU");
puts("\n\n\t\t 1. Input information \n");
puts("\t\t 2. Enter the result of the game \n");
puts("\t\t 3. Query game information \n");
puts("\t\t 4. sign out \n");
puts("\n\t\t***************************************");
puts("\n\n Please select :");
scanf_s("%d",&n);}while(0);
switch(n)
{case 1:establish();break;
case 2:enter(); break;
case 3:search();break;
case 4:exit(0);
}
}
void establish()
{
void zidingyi();
int h,r; extern int N,M,W;
y=1;
printf("\n Please enter the number of schools :");
scanf_s("%d",&N);
printf("\n Please enter the number of male athletes :");
scanf_s("%d",&M);
printf("\n Please enter the number of female athletes ");
scanf_s("%d",&W);
printf("\n There are three weighting methods , Please select :");
printf("\n\n\t1). The first seven points , Second place, five points , Third place, three points , Fourth place, five points , Fifth place, one point .");
printf("\n\n\t2). The first five points , Second place, three points , Third place, one point .");
printf("\n\n\t3). It's up to you to define .");
printf("\n\n Please enter the number (1--3):");
scanf_s("%d",&h);
switch(h)
{
case 1:j=1;break;
case 2:j=2;break;
case 3:zidingyi();
}
printf(" Set up the success \n Pressing any key will the menu ");scanf_s("%d",&r);
menu ();
}
void enter()
{
int t,r,i=0;extern int j,y;char F,M;
void mark(int j,int i);
do
{
printf("\n Please enter the athlete's name :");scanf_s("%s",&stu[i].name);
printf("\n Please enter the athlete's school :");scanf_s("%s",&stu[i].shool);
printf("\n Please enter the athlete's event :");scanf_s("%s",&stu[i].item);
printf("\n Please enter the gender of the athlete (m\w):\t");scanf_s("%s",&stu[i].sex);
printf("\n Please enter the ranking :");scanf_s("%d",&stu[i].mingci);
mark(j,i);
loop_2:printf("\n\n Continue to enter the code ?\t1).Yes\t2).No\t");
scanf_s("%d",&t);
if(t==2)break;
i++;
}
while(t==1);f=1;
printf(" Input successful \n Please press any key to exit ");scanf_s("%d",&r);
menu ();
}
void search()
{
int r; void search_school(),search_item();
int e;char c;extern int f;
if(f==0)
{
printf(" Please enter the data first \n Enter any key to exit ..\n");
scanf_s("%s",&c);
menu();
}
loop:printf("\n Please select the retrieval type :\n\t1). Search by school \n\t2). Retrieve by item \n\t3). sign out \t");
scanf_s("%d",&e);
switch(e)
{case 1:search_school();{printf(" Input successful \n Please press any key to exit ");scanf_s("%d",&r);menu ();}
case 2:search_item();{printf(" Input successful \n Please press any key to exit ");scanf_s("%d",&r);menu();}
case 3:menu ();
}
}
void search_school()
{ void printf_one(),printf_face(),printf_sum();
int x,sum=0,w=0;
struct student s;
printf("\n Please enter the name of the school you want to search :");
scanf_s("%s",&s.shool);
printf_face();
for(x=0;x<A;x++)
if(strcmp(s.shool,stu[x].shool)==0)
{sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{printf("\n\n There is no such school , Please re-enter ");search_school();}
}
void search_item()
{void printf_one(),printf_face(),printf_sum();
int x,sum=0,w=0;
struct student s;
printf("\n Please enter the name of the item you want to retrieve :");
scanf_s("%s",&s.item);
printf_face();
for(x=0;x<A;x++)
if(strcmp(s.item,stu[x].item)==0)
{sum+=stu[x].mark;
printf_one(x);w=1;
}
printf_sum(sum);
if(w==0)
{printf("\n\n
This item does not exist , Please re-enter ");search_item();}
}
void mark(int j,int i)
{int g; extern int p[15],q[15];
if(j==1)
{if(stu[i].mingci==1)stu[i].mark=7;
else if(stu[i].mingci==2)stu[i].mark=5;
else if(stu[i].mingci==3)stu[i].mark=3;
else if(stu[i].mingci==4)stu[i].mark=2;
else if(stu[i].mingci==5)stu[i].mark=1;
}
if(j==2)
{if(stu[i].mingci==1)stu[i].mark=5;
else if(stu[i].mingci==2)stu[i].mark=3;
else if(stu[i].mingci==3)stu[i].mark=1;
}
if(j==3)
{for(g=0;g<15;g++)if(stu[i].mingci==p[g])stu[i].mark=q[g];}
}
void zidingyi()
{static int p[15],q[15],a,b,j;
for(a=0;a<15;a++)
{printf("\n Please enter the rank to be defined :");scanf_s("%d",&p[a]);
printf("\n Please enter the score of this position :");scanf_s("%d",&q[a]);
loop:printf("\n Do you want to continue to define ?1).Yes\t2).No");scanf_s("%d",&b);
if(b==2)break;
if(b!=1)goto loop;
}
j=3;
}
void printf_one(int x)
{printf("\n%-20s%-20s%-20s%-5c%-9d%-5d",stu[x].shool,stu[x].name,stu[x].item,stu[x].sex,stu[x].mingci,stu[x].mark);
}
void printf_sum(int sum)
{printf("\n\n The total score is :\t %d",sum);
printf("\n The total number of schools is :\t%d",N);
printf("\n The total number of projects is :\t%d\n",W+M);
}
void printf_face()
{
printf("\n\n The name of the school Athlete name project Gender Ranking fraction ");}

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270256276093.html

Random recommended