第三次作业

一、英语翻译

 

二、gitos账号 liuerpei

三、

#include <stdio.h>

int main()/*定义主函数*/void fun(int a[10]);
/*在fun函数中定义数组a*/
int a[10]={1,2,3,4,5,6,7,8,9,10};
/*数组a赋值*/}

void fun(int a[])/*定义子函数fun*/int i;
     int *p;
     p=&a[i];
     for(i=0;i<=9;i++)
     printf("%d\n",i);

}
     
     
Compilation Failed
/usercode/file.cpp:4:1: error: stray '\357' in program
 {
 ^
/usercode/file.cpp:4:1: error: stray '\275' in program
/usercode/file.cpp:4:1: error: stray '\233' in program
/usercode/file.cpp:5:2: error: stray '\357' in program
  void fun(int a[10]);
  ^
/usercode/file.cpp:5:2: error: stray '\274' in program
/usercode/file.cpp:5:2: error: stray '\210' in program
/usercode/file.cpp:5:2: error: stray '\357' in program
/usercode/file.cpp:5:2: error: stray '\274' in program
/usercode/file.cpp:5:2: error: stray '\211' in program
/usercode/file.cpp:10:1: error: stray '\357' in program
 void fun(int a[])/*定义子函数fun*/
 ^
/usercode/file.cpp:10:1: error: stray '\274' in program
/usercode/file.cpp:10:1: error: stray '\210' in program
/usercode/file.cpp:10:1: error: stray '\357' in program
/usercode/file.cpp:10:1: error: stray '\274' in program
/usercode/file.cpp:10:1: error: stray '\211' in program
/usercode/file.cpp:11:1: error: stray '\357' in program
 {   int i;
 ^
/usercode/file.cpp:11:1: error: stray '\275' in program
/usercode/file.cpp:11:1: error: stray '\233' in program
/usercode/file.cpp:5:2: error: expected initializer before 'void'
  void fun(int a[10]);
  ^
/usercode/file.cpp:8:18: error: expected declaration before '}' token
 /*数组a赋值*/
                     ^
 
 

 用的是手机上的软件 所以还是出错了 等我上电脑调试一下

#include <stdio.h> 

int main(){
void fun(int a[10]);
/*在fun函数中定义数组a*/
  int a[10]={1,2,3,4,5,6,7,8,9,10};
/*数组a赋值*/}

void fun(int a[])/*定义子函数fun*/
{
     int i;
     int *p;
     p=&a[i];
     for(i=0;i<=9;i++)
     printf("%d\n",*(p++));

}

1
2
3
4
5
6
7
8
9
10

--------------------------------
Process exited after 0.01536 seconds with return value 0
请按任意键继续. . .

 

后再在电脑上修改 之前的错误原因为中英输入不识别 无效符号

总结:不能忽略低级错误!!!

 其次是子函数的调用及条件应该多加尝试 中途也有几次什么也输不出来 然后又重调试几次调试出来了 让我疑惑

最后是 不能在手机上写 分辨不出中英文!!!

 

 

转载于:https://www.cnblogs.com/ljxwtw/p/6664335.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值