数学女子学园电影版:C语言的题

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 16:06:46
#include
func(int a)
{
int x;
if(a<=5) x=6;
else=5;
return(x);
}
func2(char b)
{
char a[]="this program is very easy ! believe me! do not see that programe is very long "
printf("%s",a[]);
}
}
main()
{
int i,j,k;
printf("if you want to see me,please make it out,I believe you can do it, come on!");
for(i=0;i<=5;i++)
j=(func(i)+1)^6;
printf("密码=%8d",j);
K=func2;
}

我只能说你写的非常乱,全都是语法错误,并且不知道你在问什么。劝你仔细看一下相关教材。
因为问题不是出在这一个程序上,而是出在你的知识上。

楼主 不知道你想实现什么
不过 有几雒飨缘拇?
1. 开头include<stdio.h>
2. fun(int a) 中 else=5;改成 else x=5;
3. func2(char b)中 你的形参是b ,但在函数体中用的却是a;
4. main()中 K=func2; 如果用到了K,那么fun2()中应有返回值,并且要给fun2();赋参数;

#include 后面是啥?
else x=5;吧?
13或14行多了一个}
K=func2; 是干啥的?

#include <iostream>
using namespace std;
或者C语言的就是#include<stdio.h>
else x==5;

正确程序如下:
#include <stdio.h>
func(int a)
{
int x;
if(a<=5)
x=6;
else x=5;
return(x);
}
func2(char b)
{
char a[]="this program is very easy ! believe me! do not see that programe is very long " ;
printf("%s",a);

}

main()
{
int i,j,k;
printf("if you want to see me,please make it out,I believe you can do it, come on!");
for(i=0;i<=5;i++)
j=(func(i)+1)^6;
printf("密码=%8d",j);
//k=func( );
}
运行结果:if you want to see me,please make it out,I believe you can do it, come on!密码= 1