
#include <stdio.h> int main(void) { int b = 4; static float a = 4; float c = a+b; printf("%f\n", c); return 0; }
#include <stdio.h> int main(void) { int b = 4; static float a = 4; float c = a+b; printf("%f\n", c); return 0; }
public class main { int a = 90; static float b = 10.98f; public static void main(String args[]) { main s = new main(); //float c = a + b; float c = s.a + s.b; System.out.println("c =" +c); } }
public static void main(String args[]) { //main s = new main(); float c = a + b; //float c = s.a + s.b; System.out.println("c =" +c); }在这个main函数中应该是能直接使用main类当中的数据成员吧? 请指点
float c(2); int d(2);上面这样子不可以
float []c = new float[3];上面这样子可以
float c = new float(3);上面这样子不可以
byte []buffer = new byte[100]; int s = 0; try { System.out.println("输入一个字符串: "); s = System.in.read(buffer); String string = new String(buffer, 0, s); System.out.println(string); System.out.println(string.toUpperCase()); System.out.println(string.toLowerCase()); } catch (IOException e) { }