Advertisement
Myknakryu

Algorytm5 Java fast

Sep 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 KB | None | 0 0
  1. public class Algorytm5 {
  2.     public static void main(String[] args)
  3.     {
  4.  
  5.         int a, i, x, suma;
  6.  
  7.         a = 2;
  8.         i = 0;
  9.         x = 4;
  10.         suma = 0;
  11.  
  12.         for(;i < 4;)
  13.         {
  14.             i++;
  15.             suma = suma + a;
  16.             a = a + x;
  17.         }
  18.  
  19.         System.out.println(suma);
  20.     }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement