/** * @author liuwq * @create 2023-03-21 20:56 */ publicclass 小红填符号 { publicstaticvoidmain(String[] args)throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s = br.readLine(); String[] in = s.split(" "); double a = Double.parseDouble(in[0]); double b = Double.parseDouble(in[1]); double c = Double.parseDouble(in[2]); double x = Double.parseDouble(in[3]); if (a + b + c == x){ System.out.println("+ +"); }elseif (a + b - c == x){ System.out.println("+ -"); }elseif (a + b * c == x){ System.out.println("+ *"); }elseif (c != 0 && a + b / c == x){ System.out.println("+ /"); }elseif (a - b + c == x){ System.out.println("- +"); }elseif (a - b - c == x){ System.out.println("- -"); }elseif (a - b * c == x){ System.out.println("- *"); }elseif (c != 0 && a - b / c == x){ System.out.println("- /"); }elseif (a * b + c == x){ System.out.println("* +"); }elseif (a * b - c == x){ System.out.println("* -"); }elseif (a * b * c == x){ System.out.println("* *"); }elseif (b != 0 && a / b + c == x){ System.out.println("/ +"); }elseif (b != 0 && a / b - c == x){ System.out.println("/ -"); }elseif (b != 0 && a / b * c == x){ System.out.println("/ *"); }elseif (b != 0 && c != 0 && a / b / c == x){ System.out.println("/ /"); }else { System.out.println("? ?"); } } }
小红和R
题目
小红非常喜欢红色,以至于她也很喜欢红色(RED)的英文单词的首字母:R。现在她想让你画出大小为 n 的”R”,你能帮帮她吗?具体画法参考样例。请不要在行尾添加多余的空格。