因为不是资讯背景,所以做到资料处理与程式有关的题目时都需要去网页上查询解答对照
可是往往会发现补习班给的解答在可以提供compile&execute的网页上常常跑不出来
我都用这个网站跑 http://www.compileonline.com/compile_java_online.php
都会显示错误
想请问是因为解答本身就只是照着题目作答,而不符合实作的完整
还是问题出在我查询的网站
因为真的对写程式题毫无头绪也没有什么概念,才会问这种问题><
例如101地特资料处理第四题
![]()
public String AddThreeCodes(String inputstring){
int i,j;
char c;
String outputstring="";
for(i=0;i<inputstring.length();i++){
c=inputstring.charAt(i);
j=(int)c;
j=j+3;
c=(char)j;
outputstring=outputstring+String.valueOf(c);
}
System.out.println(outputstring);
return outputstring;
}
这个补习班答案我照着打在上面的网站上
可是却跑不出来结果
是因为题目说撰写一个函数而不是程式吗??
先谢谢大家抽空回答!!