Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- class IFf(String[] args)
- {
- int a;
- int b;
- System.out.println("найти сумму A + B");
- public void setA(Integer _a) {
- a = _a;
- }
- public void setB(Integer _b) {
- b = _b;
- }
- void vvod1(int a,int b)
- {
- Scanner in = new Scanner(System.in);
- System.out.println("Enter a: ");
- int a = in.nextInt();
- System.out.println("Your input is: " + a);
- Scanner in = new Scanner(System.in);
- System.out.println("Enter b: ");
- int b = in.nextInt();
- System.out.println("Your input is: " + b);
- }
- void printAplusB(int a, int b)
- {
- if (a>b)
- {
- System.out.println("summa A + B"+ (a + b));
- }
- }
- public static void main( String[] args )
- {
- IFf c= new IFf();
- c.setA(59);
- c.setB(50);
- }
- }
- class Wwhile(String[] args)
- {
- System.out.println("возвести с в квадрат");
- int c;
- void vvod2(int c)
- {
- Scanner in=new Scanner(System.in);
- System.out.println("Enter c: ");
- int c=in.nextInt();
- System.out.println("Your input is: "+c);
- }
- public void setC(Integer _c)
- {
- c=_c;
- }
- void cvkvadrate(int c)
- {
- while(c>=0)
- {
- System.out.println("c v kvadrate'="+c*c);
- }
- }
- public static void main(String[]args)
- {
- Wwhile d =new Wwhile();
- d.setC(5);
- }
- }
- class Ddowhile(String[] args)
- {
- System.out.println("увеличить d на 1");
- int d;
- void vvod3(int d)
- {
- Scanner in=new Scanner(System.in);
- System.out.println("Enter d: ");
- int d=in.nextInt();
- System.out.println("Your input is: "+d);
- }
- public void setD(Integer _d)
- {
- d=_d;
- }
- void yvelicnnaodin()
- {
- int d;
- do
- {
- System.out.println(i);
- d++;
- }
- while(d<10);
- }
- public static void main(String[]args)
- {
- Ddowhile c =new Ddowhile();
- c.setD(4);
- }
- }
- class ffreach(String[] args)
- { System.out.print("Найти сумму элементов массива")
- void vvod4(int array[])
- {
- Scanner input = new Scanner(System.in);
- System.out.println("Enter array length: ");
- int size = input.nextInt();
- int array[] = new int[size];
- System.out.println("vvedite array elements:");
- for (int i = 0; i < size; i++) {
- array[i] = input.nextInt();
- }
- System.out.print (vivod array elements:");
- for (int i = 0; i < size; i++) {
- System.out.print (" " + array[i]);
- }
- System.out.println();
- }
- void summaelementov()
- {
- int sum=0,i=0;
- for(int x:nums)
- {
- println("Znachenie num [" + (i++) + "ravno:" + x);
- sum += x;
- }
- println("Summa ravna"+sum);
- }
- }
- class Sswitch(String[] args)
- {
- void vvod5
- {
- Scanner in=new Scanner(System.in);
- System.out.println("Enter s: ");
- int s=in.nextInt();
- System.out.println("Your input is: "+s);
- }
- void vibor
- {
- int s;
- switch(s)
- {
- case 1:
- System.out.println("0");
- break;
- case 2:
- System.out.println("1");
- break;
- case 3:
- System.out.println("2");
- break;
- }
- }
- public static void main(String[]args)
- {
- Sswitch c =new Sswitch();
- c.setS(4);
- }
- }
- class Ffor(String[] args) {
- void vvod6()
- {
- Scanner in = new Scanner(System.in);
- System.out.println("Enter h: ");
- int h = in.nextInt();
- System.out.println("Your input is: " + h);
- }
- void ff()
- {}
- System.out.println("Vvedite h: ");
- for (int d = h; d < 10; d++) {
- System.out.println("\d: " + d);
- }
- }
- public static class main (String[] args) {
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement