Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. param
  2. (
  3.  [string] $parossor,
  4.  [string] $paratlansor,
  5.  [int] $prospros = 0,
  6.  [int] $prosplan = 0,
  7.  [int] $planplan = 0,
  8.  [int] $planpros = 0
  9. )
  10.  
  11. $file = get-content teszt4.txt
  12. for($i = 0; $i -lt $file.length; $i++) {
  13.     if($i % 2 -eq 1)
  14.     {
  15.         $parossor += $file[$i]
  16.         $parossor += " "
  17.     }
  18.     else
  19.     {
  20.         $paratlansor += $file[$i]
  21.         $paratlansor += " "
  22.     }
  23. }
  24. "$parossor paros sorok tartalma"
  25. "$paratlansor paratlan sorok tartalma"
  26.  
  27.  
  28. foreach($i in $parossor)
  29. {  
  30.     if($i % 2 -eq 0)
  31.     {
  32.         $prospros += $i
  33.     }
  34.     else
  35.     {
  36.         $prosplan += $i
  37.     }
  38. }
  39. "paros sorok paros szamainak osszege: $prospros"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement