关于C语言:函数调用

来源:百度知道 编辑:UC知道 时间:2024/05/18 03:35:48
我想让用户按“1”就进入一的功能,按“2”就进入二的功能——
可我写的里面有好多错误~~请大家帮忙~~~
谢谢!!!

// 阿城工作室软件合集.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "math.h"
#include "stdio.h"

TextIQ();
Count();
TaxCompute();

int main()
{
int choose;

printf("\n请选择一个菜单选项:\n");

printf (" 1--测测你的智商\n");//菜单选项//
printf (" 2--北京大兴庞各庄瓜类销售合算工具\n");
printf (" 9--版权声明\n ");
printf (" 0--离开\n");
printf (" 请选择:");

scanf("%d", &choose);//选择//

if (1==choose)//判断选择//
TextIQ ();
if (2==choose)
Count ();
if (9==choose)
printf("版权由阿城工作室所有\n未经允许不得拷贝本程序\n");
if (0==choose)
printf("谢谢使用!\nBye Bye!\n");

你可以用switch语句呀

主程序的if语句系列最好放在一个循环中,如
while(1)
{
// if...
}
TextIQ()函数中
if(d=='a'||'A')改为
if(d=='a' || d == 'A')
count()函数在前面最好加上 int这是新标准,即:
int Count()
{
}
main()函数前面的函数申明应该完整,如
void TextIQ();
int Count();
等。