Pls correct my code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Pls correct my code

I am writing the code in java https://www.sololearn.com/coach/18?ref=app

22nd Feb 2020, 2:09 PM
Kavit
4 Answers
+ 1
Can you post your code here?
22nd Feb 2020, 2:11 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 1
Your code, not the problem.
22nd Feb 2020, 3:07 PM
Aymane Boukrouh
Aymane Boukrouh - avatar
22nd Feb 2020, 3:05 PM
Kavit
0
import java.io.*; public class Program { public static void main(String[] args) throws IOException { BufferedReader input=new BufferedReader(new InputStreamReader(System.in)); String st=input.readLine(); int a=Integer.parseInt(input.readLine()); String st1=input.readLine(); st1=" "+st1; int len=st1.length(); char ch; int count=1; int time; for (int i=0;i<len;i++) { ch=st1.charAt(i); if(ch==' ') count++; } time=(count/a)*20; System.out.println(time); } }
22nd Feb 2020, 3:25 PM
Kavit