Directory
1 Problem Description
2 Solutions
1 problem description Problem Descriptiondo you want to score this question? If you want, please output "yes" or no, please output "no". output Formatthe output includes a row, either "yes" or "no".
2 Solutions
First of all, This problem unexpectedly did not input output sample, but it is not difficult. well, for the first time, the code looks like This:
Importjava.util.Scanner; public classmain{ public Static voidmain (string[] Args) {Scanner in=NewScanner (system.in); String A=In.nextline (); if(a.equals ("think")) System.out.println ("yes"); Else if(a.equals ("don't want") {System.out.println ("no"); } }}
then, The result score is 0 points, look at the input output sample: the input is empty, the output is Yes. ok, then i'll change the Code:
Importjava.util.Scanner; public classmain{ public Static voidmain (string[] Args) {Scanner in=NewScanner (system.in); String A=In.nextline (); if(a.equals ("want") | |a.equals (null )) System.out.println ("yes"); Else if(a.equals ("don't want") {System.out.println ("no"); } }}
The result score is still 0 points, then I think this question is not so simple ... Change the Code again:
public class main{ publicstaticvoid Main (string[] Args) { System.out.println ("yes");} }
Results score 100 points, I beg my psychological shadow at the moment ...
Algorithm note _063: Blue Bridge cup practice send points (Java)