Please read the new rule regarding the restriction on the use of AI tools. ×

Runt Time erorr why ?

Revision en1, by Bahaa_Elden, 2015-12-04 18:46:13

package capitialize;

import java.util.Scanner;

public class Capitialize {

public static void main(String[] args) {

Scanner in= new Scanner(System.in); char[] st =new char[50]; int i,w,res=0; w=in.nextInt(); for(i=0;i<w;i++){ st[i]=in.next().charAt(0); if(i>0){if(st[i]==st[i-1]){res++;}}
} System.out.println(res); } }

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Bahaa_Elden 2015-12-04 18:46:13 375 Initial revision (published)