永发信息网

这样的代码为什么不对!!!!

答案:3  悬赏:70  手机版
解决时间 2021-01-26 20:27
import java.util.Scanner;
public class 作业 {
public static void main(String[] args){
System.out.println("****输入3个整数****");
System.out.println("num1=");
Scanner input=new Scanner(System.in);
int a=input.nextInt();
System.out.println("num2=");
int b=input.nextInt();
System.out.println("num3=");
int c=input.nextInt();
if(a System.out.println(a+"<"+b+"<"+c);
else{
if(a System.out.println(a+"<"+c+"<"+b);
else{
if(b System.out.println(b+"<"+a+"<"+c);
else{
if(b System.out.println(b+"<"+c+"<"+a);
else{
if(c System.out.println(c+"<"+a+"<"+b);
else(c System.out.println(c+"<"+b+"<"+a);
}
}
}
}
最佳答案
a a 还有,类名最好不要搞汉语,变量名也最好见名知意。
if else不要这么用,这么写
if(){
} else if{
}
逻辑上太啰嗦,这么一大串if else,看着真心难受。
可以专门写个排序,或者调用api Array.sort(),排序完,在输出。
全部回答
  • 1楼网友:未来江山和你
  • 2021-01-26 12:21
所谓登陆提示,是指登陆时你与服务器双向交流的一些指令及状态提示,如果看到类似这样的字样,那就是了: CuteFTP Pro 2.0 - build Dec 4 2001 *** 状态:> 正在获取列表“”... 状态:> 正在连接到 ftp 服务器 211.*.*.*:* (ip = 211.*.*.*:*)... 状态:> Socket 已连接。正在等候欢迎消息... 220 FTP服务器已启动状态:> 已连接。正在验证... 命令:> USER software 331 User name okay, need password. 命令:> PASS ***** 230 User logged in, proceed. 状态:> 登录成功。命令:> PWD 257 "/" is current directory. 这个东西是非常重要的,请一定加以注意。 常见错误分析: 如果见到下述字样,并停留较长时间状态:> 正在连接到 ftp 服务器 211.*.*.*:*(ip = 211.*.*.*:*)... 之后见到:错误:> 无法连接到远程服务器。Socket 错误 = #10060。状态:> 正在等候 30 秒... 出现该种情况 有 两种可能:一为对方未开ftp或者无法连通,请与ftp管理者联系二则是因为端口填写错误。一般默认为21,但是因为此种端口在某些网络中易引起冲突,安全性也值得商榷,故多数ftp更改了端口。如果你没 有 填写端口(ftp软件 会 默认21)或者填写错误,也 会 引起10060错误. 如果见到下述字样: Thu Mar 07 11:44:56 2002 530 Sorry, no ANONYMOUS access allowed 表明该ftp不允许匿名者登陆,请与ftp管理者联系,并取得账号 Thu Mar 07 11:46:29 2002 USER bugdown Thu Mar 07 11:46:30 2002 331 User name okay, need password. Thu Mar 07 11:46:30 2002 PASS ******** Thu Mar 07 11:46:30 2002 530 Not logged in. 有 两种可能: 1. 账号或者密码输入错误,被拒绝登陆。请先确定你没 有 输入错误(较复杂的密码建议用复制粘贴来填写,并注意 有 无空格),然后与ftp管理者联系以确认你的账号没 有 过期。目前大部分的ftp都 会 定期更改密码,所以此宗错误是最常见的。 2. 用了花生壳等动态域名, 有 时 会 出现这样的现象:如果ftp没 有 开, 有 人以动态域名登陆时,动态域名的服务商 会 将你自动转到它自己的提示性ftp,这时 有 可能出现密码错误,也 有 可能登陆到它的服务器。部分以iis为基础建立的ftp 有 可能转至微软的服务器,现象类同。 Thu Mar 07 11:51:25 2002 421 Too many users - please try again later. 这是因为ftp管理者设定了该帐号(或者该域名)的最大登陆人数,现在已经达到这一限制,因此你无法登陆。只 有 等待其他用户退出或者使用其他账号,你才可能进入ftp. 命令:> PASS ***** 530 Not logged in, only one session from same IP allowed at a time. 错误:> 未登录。状态:> 连接已关闭。该帐号只允许单线程登陆,因此请注意你是否打开多个窗口或者已经 有 一个线程在下载 在登陆人数已满,而你不断尝试登陆, 有 三种可能的情况: 1 .你终于挤进去了 2 .谈出窗口提示错误,并在登陆错误指令见到这样的字样:错误:> 控制连接已关闭。表明ftp服务器拦截你这样频繁的尝试。你可以不管它,确定之后继续尝试;但是稍 有 道德的人都应该把ftp软件的全局设置中关于连接重试尝试的间隔时间修改到较大,一般提倡30秒到2分钟。 3 .你被ban了。serv-U所作的服务器不能自动ban ip,但是管理者可以手工ban,部分服务器端软件可以自动封ip。被ban的提示为:命令:> PASS ***** 530 Not logged in, unauthorized IP address. 上面的提示: 命令:> PASS ***** 530 Not logged in, unauthorized IP address. 就是说你的ip是不合法的,不管是因 为什么 原因,总之除非你与管理者联系并解封,实在是没 有 继续尝试的必要。当然,管理者可能只是ban你一段时间,你可以过后再重新尝试。但是一定记得更改你的尝试间隔时间。 有 时候不是因为封了你,而是因为该帐号限制只 有 部分许可的ip可以登陆,同样你必须与管理者联系,请他手工添加你的ip 常见FTP登陆Log信息: 1. Connected. Waiting for response. 220 Serv-U FTP Server v4.0 for WinSock ready... USER anonymous 530 Sorry, no ANONYMOUS access allowed. QUIT 这个就是不许匿名登录啦 2. Connected. Waiting for response. 220 Serv-U FTP Server v4.0 for WinSock ready... USER test 331 User name okay, need password. PASS xxxxxx 530 Not logged in. QUIT 一般是密码输入错误时出现的信息,但对于Serv-U来说,如果没 有 这个帐号(test)存在,也 会 产生同样的出错信息。 3. Connecting to xxx.xxx.xxx.xxx, Port 21 (#1) ERROR: Connection timed out 这个表明对方未开机,也可能是对方不在你能访问的范围内 4. Connecting to xxx.xxx.xxx.xxx Port 21 (#1) ERROR: Connection refused 这个一般表明对方已开机,但未开启FTP服务(没 有 开Serv-U) 也可能为对方不提供在这个端口上的服务 5. Connecting to xxx.xxx.xxx.xxx, Port 21 (#1) Connected. Waiting for response. Disconnected from server. Connection attempt failed. Waiting for retry... 出现这个信息实在是很倒霉,你极 有 可能被对方Ban了。 如果只是Ban几分钟or几小时or一天还好,不然只 有 和站长说说好话,让他给你解封吧。 6. Connecting to xxx.xxx.xxx.xxx, Port 21 (#1) Connected. Waiting for response. USER XXX 331 User name okay, need password PASS xxxxxx 530 Not logged in, unauthorized IP address. QUIT 这个 有 点麻烦,你的IP不在站长允许访问的IP范围内,只 有 和站长联系,让他把你的IP网段加入Allow Access列表里吧 7. Connected. Waiting for response. 220 Serv-U FTP Server v4.0 for WinSock ready... USER user 421 Too many users - please try again later. 哈哈,这个很常见吧,用户太多,去过交大的都知道该怎么做 8. Connected. Waiting for response. 220 Serv-U FTP Server v4.0 for WinSock ready... USER test 530 Not logged in, only one(也 有 可能是two or three) session from same IP allowed at a time. QUIT 每个IP只能开一个(也 有 可能是two or three) 下载,就不要用多线程啦,小心Ban了你。 FTP信息代码全解: 110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm server's equivalent marker (note the spaces between markers and "=". 重新启动标志回应。这种情况下,信息是精确的并且不用特别的处理;可以这样看:标记 yyyy = mmm 中 yyyy是 用户进程数据流标记,mmmm是服务器端相应的标记(注意在标记和等号间的空格) 120 Service ready in nnn minutes. 服务在NNN时间内可用 125 Data connection already open; transfer starting. 数据连接已经打开,开始传送数据. 150 File status okay; about to open data connection. 文件状态正确,正在打开数据连接. 200 Command okay. 命令执行正常结束. 202 Command not implemented, superfluous at this site. 命令未被执行,此站点不支持此命令. 211 System status, or system help reply. 系统状态或系统帮助信息回应. 212 Directory status. 目录状态信息. 213 File status. 文件状态信息. 214 Help message.On how to use the server or the meaning of a particular non- standard command. This reply is useful only to the human user. 帮助信息。关于如何使用本服务 器或特殊的非标准命令。此回复只对人 有 用。 215 NAME system type. Where NAME is an official system name from the list in the Assigned Numbers document. NAME系统类型。 220 Service ready for new user. 连接的用户的服务已就绪 221 Service closing control connection. 控制连接关闭 225 Data connection open; no transfer in progress. 数据连接已打开,没 有 进行中的数据传送 226 Closing data connection. Requested file action successful (for example, file transfer or file abort). 正在关闭数据连接。请求文件动作成功结束(例如,文件传送或终止) 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2). 进入被动模式 230 User logged in, proceed. Logged out if appropriate. 户已登入。 如果不需要可以登出。 250 Requested file action okay, completed. 被请求文件操作成功完成 257 "PATHNAME" created. 路径已建立 331 User name okay, need password. 用户名存在,需要输入密码 332 Need account for login. 需要登陆的账户 350 Requested file action pending further information 对被请求文件的操作需要进一步更多的信息 421 Service not available, closing control connection.This may be a reply to any command if the service knows it must shut down. 服务不可用,控制连接关闭。这可能是对任何命令的回应,如果服务认为它必须关闭 425 Can't open data connection. 打开数据连接失败 426 Connection closed; transfer aborted. 连接关闭,传送中止。 450 Requested file action not taken. 对被请求文件的操作未被执行 451 Requested action aborted. Local error in processing. 请求的操作中止。处理中发生本地错误。 452 Requested action not taken. Insufficient storage space in system.File unavailable (e.g., file busy). 请求的操作没 有 被执行。 系统存储空间不足。 文件不可用 500 Syntax error, command unrecognized. This may include errors such as command line too long. 语法错误,不可识别的命令。 这可能是命令行过长。 501 Syntax error in parameters or arguments. 参数错误导致的语法错误 502 Command not implemented. 命令未被执行 503 Bad sequence of commands. 命令的次序错误。 504 Command not implemented for that parameter. 由于参数错误,命令未被执行 530 Not logged in. 没 有 登录 532 Need account for storing files. 存储文件需要账户信息 550 Requested action not taken. File unavailable (e.g., file not found, no access). 请求操作未被执行,文件不可用。 551 Requested action aborted. Page type unknown. 请求操作中止,页面类型未知 552 Requested file action aborted. Exceeded storage allocation (for current directory or dataset). 请求文件的操作中止。 超出存储分配 553 Requested action not taken. File name not allowed 请求操作未被执行。 文件名不允许
  • 2楼网友:行雁书
  • 2021-01-26 11:16
所有的代码不能有中文字符,注释里面可以有、、、、||-_- 而且你少了package的打包语句 更加重要的是没有a
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯