c语言字符菜单

来源:百度知道 编辑:UC知道 时间:2024/05/27 11:15:39
main()
{
char ch;
for(;;){
system("cls");
printf("\n=====menu=====");
printf("\n1.输出两个整数的较小者");
printf("\n2.判断输入的字符是否为大写");
printf("\n3.求四个数中的最大数");
printf("\n4.求小于20的整数的阶层");
printf("\n5.exit");
printf("\n==============");
ch=getch();
if(ch=='5')break;
switch(ch){
case'1':int a,b,c;
~~~~~~为什么显示第一个printf~~
D:\C++\MSDev98\Bin\123.cpp(21) : error C2065: 'printf' : undeclared identifier
应该怎么修改~~
急求啊~~
谢各位高手

你要加上头文件#include <stdio.h> 才行的~~

PS:你写C程序,绝不能忘了这个头文件的

包含头文件:
#include <stdio.h>
#include <stdlib.h>

包含如下头文件:
#include "stdio.h"

#include <stdio.h>
main()
{
char ch;
for(;;){
system("cls");
printf("\n=====menu=====");
printf("\n1.输出两个整数的较小者");
printf("\n2.判断输入的字符是否为大写");
printf("\n3.求四个数中的最大数");
printf("\n4.求小于20的整数的阶层");
printf("\n5.exit");
printf("\n==============");
ch=getch();
if(ch=='5')break;
switch(ch){
case'1':int a,b,c;