全部评论
先拍个序
可能无序吧
哎呀 我也做了这一题,也是通过不了
public static void main(String[] args) {
Scanner sc = new Scanner(System.in); while (sc.hasNext()) {
String str = sc.nextLine(); int count = 0; char c,c1; for (int i = 0; i <str.length() ; i++) {
c = str.charAt(i); if(i!=str.length()-1){
c1 = str.charAt(i+1); }else {
c1 = c; } if(c!=c1){
count++; }
}
System.out.println(count); }
}
没有输入输出吧。
这没法运行吧,没有输入也没有函数调用。
啥意思
禁用io吧
相关推荐

点赞 评论 收藏
分享
06-13 10:15
门头沟学院 Java 点赞 评论 收藏
分享
点赞 评论 收藏
分享