uoid list(struct library book[],int m) { int i; system("cls"); printf("图书馆图书信息如下:\n"); printf("\t图书编号\t图书名称\t作者\t单价\t出版社\t\t出版时间\t存在状态\t读者姓名\t读者学号\n"); for(i =0;i<m;i++) ? printf("\t%6d\t%12s\t%18s\t%4.2f\t%65\t",book[i].book_num,_____填空__,book[i].author_name,____填空___,book[i]-publisher); printf("\t%4d-%2d-%2d\t%2s\t%6s\t%8d\t\n", book[i]-publish_time, book[i].book_state,book[i].reader_name, book[i].reader_num); } printf( **\n"); printf("\t press any key enter menu......\n"); printf ***¥x\n""); 人 getchar(); getchar(); system("cls"); 完善代码
时间: 2023-08-02 14:09:56 浏览: 45
void list(struct library book[], int m)
{
int i;
system("cls");
printf("图书馆图书信息如下:\n");
printf("\t图书编号\t图书名称\t作者\t单价\t出版社\t\t出版时间\t存在状态\t读者姓名\t读者学号\n");
for (i = 0; i < m; i++)
{
printf("\t%6d\t%12s\t%18s\t%4.2f\t%65s\t", book[i].book_num, book[i].book_name, book[i].author_name,
相关问题
uoid list(struct library book[],int m) { int i; system("cls"); printf("图书馆图书信息如下:\n"); printf("\t图书编号\t图书名称\t作者\t单价\t出版社\t\t出版时间\t存在状态\t读者姓名\t读者学号\n"); for(i =0;i<m;i++) ? printf("\t%6d\t%12s\t%18s\t%4.2f\t%65\t",book[i].book_num,_____填空__,book[i].author_name,____填空___,book[i]-publisher); printf("\t%4d-%2d-%2d\t%2s\t%6s\t%8d\t\n", book[i]-publish_time, book[i].book_state,book[i].reader_name, book[i].reader_num); } printf( **\n"); printf("\t press any key enter menu......\n"); printf ***¥x\n""); 人 getchar(); getchar(); system("cls"); 找到错误并且改正
void list(struct library book[], int m)
{
int i;
system("cls");
printf("图书馆图书信息如下:\n");
printf("\t图书编号\t图书名称\t作者\t单价\t出版社\t\t出版时间\t存在状态\t读者姓名\t读者学号\n");
for (i = 0; i < m; i++)
{
printf("\t%6d\t%12s\t%18s\t%4.2f\t%65s\t", book[i].book_num, book[i].book_name, book[i].author_name, book[i].book_price, book[i].publisher);
printf("\t%4d-%2d-%2d\t%s\t%s\t%d\n", book[i].publish_time.year, book[i].publish_time.month, book[i].publish_time.day, book[i].book_state, book[i].reader_name, book[i].reader_num);
}
printf("\n\n");
printf("press any key enter menu......\n");
getchar();
getchar();
system("cls");
}
#include<stdio.h> int i=1;uoid other()static int a=2;static int b;int c=19;a=a+2; i=i+32; C=C+5;printf("-----0THER------\n");printf("i:%d a:%d b:%d c:%d\n",i,a,b,c)b=a; int main() static int a;register int b=-19; int c=日;printf("-----MAIN------\n");printf
("i:%d a:%d b:%d c:%d\n",i,a,b,c);a=3; b=b+2; c=c+5; printf("i:%d a:%d b:%d c:%d\n",i,a,b,c);other();printf("i:%d a:%d b:%d c:%d\n",i,a,b,c);return 0;}
这段代码有一些问题,首先是语法错误。第一行 `#include<stdio.h> ` 应该是 `#include <stdio.h>`,少了一个空格。然后是第二行 `int i=1;uoid other()`,应该是 `void other()`,少了一个字母。接着是 `uoid` 应该是 `void`,也是一个拼写错误。还有 `register` 关键字在 C++11 标准中已经被弃用,不建议使用。
此外,函数 `other()` 中的变量 `C` 是没有定义的,应该改为小写的 `c`。还有 `b=a;` 这句代码没有意义,因为 `a` 的值在 `other()` 函数中已经被修改了。最后,代码中没有 `C`,应该是 `c`。
修正后的代码如下:
```
#include <stdio.h>
static int a = 2;
static int b;
int c = 19;
int i = 1;
void other() {
a = a + 2;
i = i + 32;
c = c + 5;
printf("-----OTHER------\n");
printf("i:%d a:%d b:%d c:%d\n", i, a, b, c);
}
int main() {
static int a;
int b = -19;
int c = 0x65;
printf("-----MAIN------\n");
printf("i:%d a:%d b:%d c:%d\n", i, a, b, c);
a = 3;
b = b + 2;
c = c + 5;
printf("i:%d a:%d b:%d c:%d\n", i, a, b, c);
other();
printf("i:%d a:%d b:%d c:%d\n", i, a, b, c);
return 0;
}
```
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)