mercredi 18 septembre 2019

I dont know how to write this in code(in summary too big for title)

im writing a program where if the string is divisble by 3 it prints the string 3 letter at a time ex. computers=com put ers this is what i have but i keep getting errors

.

                  int len=rts.length();
                if(rts.length()%3==0) {
                    for(int i=0;i<=len; i++) {
                        System.out.print(rts.substring(i,i));
                        System.out.print(rts.substring(i,i+1));
                        System.out.print(rts.substring(i,i+2));
                        System.out.println();

                    }}
                    else{
                    for(int i=0; i<=10; i++) {
                        System.out.println(rts);

It should be ex. computers= com put ers

Aucun commentaire:

Enregistrer un commentaire