0
Pls correct my code
I am writing the code in java https://www.sololearn.com/coach/18?ref=app
4 odpowiedzi
+ 1
Can you post your code here?
+ 1
Your code, not the problem.
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);
}
}