c语言4的个指针问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 07:42:02
1。写一个函数,将一个3*3的矩形转置
2。输入一个字符串,内有数字和非数字字符,将其中连续的识字作为一整数,依次存放到一数组a中。
3.编写一个函数printf,打印学生的成绩数组,该数组中有5个学生的数据记录,有个记录包nvm,name,score[3],用主函数输入这空记录,(用printf函数输出)

1:
#include<stdio.h>
#define N 3

int arr[N][N]={1 ,2 ,3 ,4 ,
5 ,6 ,7 ,8 ,
9};
int temp[N][N];

void left();
void right();
void main()
{ char c;
printf("Input \"l\" to turn left, \"r\"to turn right \"Q\" to quit:\n");
while(1)
{ c=getch();
switch (c)
{
case 'l':;
case 'L':left();break;
case 'r': ;
case 'R':right();break;
case 'q': ;
case 'Q':exit(0);
default : break;

}

printf("\n");
printf("Input \"l\" to turn left, \"r\"to turn right \"Q\" to quit:\n");

}
getch();
}

void right()
{