RKI Cykl I - Imię Nazwisko
Transkrypt
RKI Cykl I - Imię Nazwisko
! "! # "! $ !$% !# & ! '$( ) # * !# + ,# -$( ! $( "! $.+ !$% /+0+1 * $$% $*# ! $!*2$3$# $$%(&/+0!$% 456+ ! + ! " "##$ % "&%# % '$( %)" "& *""+ " %#( ! "%$ " "&"#,#"&") "+$ ""& %) "& "& % - . / "&" $ + $ ( 0 %)" %$"#, "&# " % )$ "&# %$ "&" $+%%)1"(0 %)" 2)2 )$ )$ " "& "&2"& "&( 3% " - 4 3 $ ( $ ) % "& "&,#2 %). / ( %)" "&% "&"#(" * +% "% " $ %"), , ),) "" 52# "&)" #6(7 2) %$" ( 0 $2"& "& + ""( 8 %)+ % $ " , 1" 2%" 9$ "%( "" %)" "& $ "& %)1" $ ) $( 3 $ 2 ) # 2 %) "&( 8$% % 2 % 4 , # "&") "+ $"( 8 %)" 2%% "%) $ , $ "% "& $ # 51 $ "6( 3 %"& %)" "& $ $ %) "& ( -&"2 $ 2$ "&:#(- %)+ $% ;"%( * "% )$ $ "&$ #" #. /( 0 %)" 2 %)" "$* % +" (- %)+ 5"%6 ! %)" "& * + *, * " ( 0 "&)" """#("#$2%%"#%# % '8"""&) "&$ % "& "&"# %#( 1078 "# <"%) #$)"$ =8> ,? , "%( ?% %= 3" 9078 + , -* . ! $ • • • • • • 0 %1+ $ $ " 0 %1+$)& 0 %1+$) * "&$2 * % % * 2#"% %)1+ $% 2 1 $# . $ "& @ ""& % $ "% @""& "& #( 9$ "% # ")" = • • • • • • 5 )$ 1"& #6, $ $$ 1"5$ $$ 1"#$8,38,$(6, 1"5 $ 6, )$ #, $# #, % ( %% "% $ %) * %" $ ") @""& # "& $ " ( &7&? , 8 " $22 @""&# #%). / % $#( String lancuch; lancuch = "Moj lancuch znakow"; $%1"$ 2" #( char[] tablica = new char[DLUGOSC]; 9"1"%#**1+%$) $ $ "% @""&# #= tablica = lancuch.toCharArray(); lancuch = String.copyValueOf(tablica); //String -> char[] //char[] -> String 7/078 / #7? & G 2" # "&, # $"&% $"# @""& %" "& "& $$( G$* @,#%"%)$ ( 8% $ )"( • • • • • )= 2)$$"# @""& , *1+ $"#, $# @""&#, 2 @""&#( 3 $ $ , # $2 %1" @""& # 5& 6 $ % 1+ $ ( ?2 + $# @""&#, 2 *+ "% )$% $ , # $ $# #"& ""% 6( haslo.equals(wprowadzone) % % 1+ 2 ( . / *" $ $# 5& WW $ 6,$ *%$ $ 1" @""&# #( # # &# , import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String wprowadzone = in.next(); String haslo = "test"; if (haslo.equals(wprowadzone)) System.out.println("OK"); } } " 4 # > ")$ $2%$"#"& # @""&( 0 $$ )$$%""& #5$"& 6 $""& ?56(0 5$2% 2" "&6( String t = "test"; System.out.println(t.charAt(1)); //wypisana zostanie litera e ;8078 * +#4 , 8 2 2 % $ + $$ 1+ 2)" " # $ " Q2&F%FQ( 8 $$+ * $ # )$%""& D "& %" "& %$ +,"*%$ 2 "&( / 7 * *+ $), #% * %$ + "2) " , ) $$+$ '%"$ +" $ $$ ( ? "% $),%1$ $ ' " "% ""& #( / $2 ,# 2) $ *$ ( 3 $" %%% 1+(%"& "% "&%%% 1+ )$%"$#2 valid = valid && CZY_PODANO_PRAWIDŁOW_LITER 7) 2) 1+ ,% %2) $( 3 * $ ) +, * @""& "& , )" $ $ * $ + * ) *%( 0 )$%" valid = true; for (int i=1; i<=4; i++){ wylosuj numer znaku zapytaj o ten znak valid = valid && (czy podano prawidłowy znak); } # &# , ."1" $",$ *$ 2 **)+ $$ +$( import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String telekod = "bfhe3nfj32"; boolean valid = true; for (int i=1;i<=4;i++){ int p = (int)(Math.random()*telekod.length()); System.out.println("Podaj " + (p+1) + " znak telekodu"); char c; c = in.next().charAt(0); //ze standardowego wejcia pobieramy łacuch i odczytujemy jego pierwszy (i jedyny) znak. valid = valid && telekod.charAt(p)==c; } if (valid) System.out.println("Podane dane s poprawne"); else System.out.println("Podane dane s NIEPRAWIDŁOWE"); ;0078 } } C 4 # $ "& %""& @""& "& ") $2% )$ # 1"& $"% "&( 9 % $"% $ 1 $$ $ ( G $ $#2) "% $"#"&$"% @""& #( 3 $%""& #%). / % $ (K#$% ,* "& ?56$ "#( 7 %$ * + % 2") # "& `a )$, $ "% $"& %" 2",# +%%% $( String lancuch = "przykladowy lancuch"; char[] tablica = lancuch.toCharArray(); tablica[0]='P'; lancuch = String.valueOf(tablica); System.out.println(lancuch); // na standardowe wyjcie wypisany zostanie tekst: Przykladowy lancuch <# * $ "%$ ?-($ 1%*"%D( G$"& * $ "+$" "2, * * * +% "2)5 ?- 6( ?2 $ "+ $ "& $ " + ( ! % $ $ %$,% $( System.out.println((int)'a'); //zostanie wypisana liczba 97 82 $ "= System.out.println((char)98); //zostanie wypisana litera b 0, $ "& for (int i = 'a';i<='z';i++){ System.out.print(i + ":" +(char)i + ", "); } 2) $ += 97:a, 98:b, 99:c, 100:d, 101:e, 102:f, 103:g, 104:h, 105:i, 106:j, 107:k, 108:l, 109:m, 110:n, 111:o, 112:p, 113:q, 114:r, 115:s, 116:t, 117:u, 118:v, 119:w, 120:x, 121:y, 122:z, ;1078 * & , 82 %1" %") "&(0 @ ( # - 2" # ?- * %1" 2"%( B " %222, (91+$) $ %"%% % # )#*""2$%""&?- %%(?2 + ) , *$%"%?-%+)1+( # - int odleglosc = (int)'a'-(int)'A'; # - 8 +$$"& `ai # &# &# import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String input; input = in.next(); char[] input_array = input.toCharArray(); int odleglosc= (int)'a'-(int)'A'; for (int i=0;i<input_array.length;i++){ input_array[i]=(char)((int)input_array[i]-odleglosc); } input = String.valueOf(input_array); System.out.println(input); } } %*,% " + %%") "&$"% "& @""& #( > ") $2 % *1+ $2 2 $" @""& ' $ %" %%") $"% "&; ( * 2+ 2 "% 5$ %" $ $2 %" $6 2 + "&)$"&$( % )$%"= String s="Tekst"; s.substring(a,b); " $" " " %" ) $"% 5$ ) % $"% " 6, @"") $"%2(8"%)2* 2"+ %" * 1+$"( %%"% % %= ;9078 s.substring(a); 0 " $""2%%" $"% @" "( String s = "testowy ciag"; String subs = s.substring(0,0+4); System.out.println(subs); String subs2 = s.substring(5,5+2); System.out.println(subs2); String subs3 = s.substring(8); System.out.println(subs3); //test //wy //ciag ? , " % %1" @""& # %") #"& $H(H( 8$ :$ @""& , "$ $ 5 *6( to.jest.test to jest test 3 $" *+, * $ % $" " @""& %1" $ ,#"&%%" "& %%)$( 8" $ @""& *$ ) +, " ) $ 52) 2%" $"" @""& , 2$ $ $ %$"6( 3 * #* + ) @"( >) 2 %" $ $ $, 2 "( 8 )" = j=0 for (int i=0;i<=dlugo_łacucha;i++){ Jeeli osignłe koniec łacucha lub znak na pozycji i to kropka { pobierz podcig znaków od pozycji j do i-1 włcznie ustaw j=i+1 jako pocztek nowego wyrazu } } $ $)$ + )$%"= i==ciag.length() || ciag.charAt(i)==' ' 0 #), " "% %$$ S 7 * _ " (&56 $ "% WW" (&56 + ( #" " * % $ %1 $ 1$)( ;:078 .* " @""& 5 1" % $ 6, #" "% WW" (&56 2)$ $ +%")1" ( # ##& import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String ciag; ciag = in.next(); int j=0; for (int i=0;i<=ciag.length();i++){ if (i==ciag.length() || ciag.charAt(i)==' '){ System.out.println(ciag.substring( j,i)); j=i+1; } } } } * " % %1" @""& # "2)( $ $#% $" 5 "& $"# )$% " @""& 2 26 @""& 1" #( abcde 3 abc bcd cde # - %$))$%"$"1", " %")%"& # @""&( # - 0 2 %, 2 "% $)$ # @""&( # # #& import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String ciag = in.next(); int n = in.nextInt(); ;7078 for (int i =0;i<=ciag.length()-n;i++){ System.out.println(ciag.substring(i,i+n)); } } } = ? j" @""&#%2 $$ ) $ A( G $ "%* + $(3"& + 2"%$ "% @""&#( * #* +$ AW,#% 1"%$ %%% @""&52 1+%6$ $ %( String t ="testowy"; String c ="ciag"; String calosc = t + " " + c; calosc += "!"; System.out.println(calosc); //"testowy ciag" //"testowy ciag!" * 'DD 3 $$ ,#" %1" " (8 + $" Q Q$$ * $ Q Qi 3 $$2 %*"$#2" " (%" $""% zmienna = in.next(); $2 $%$ "%( .* "&" " + " , %" $ "%, + "% $2 %"% " , * @" ( zmienna = in.nextLine(); # - 8 $ +$2% $$ " , * +%$ "% $( " $2 $" $%" * + $ % $%"% ( # #&##& import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); ;;078 String ciag; String wynik = ""; String przedrostek = "ka"; ciag = in.nextLine(); System.out.println(ciag); int j=0; for (int i=0;i<=ciag.length();i++){ if (i==ciag.length() || ciag.charAt(i)==' '){ wynik += przedrostek + ciag.substring( j,i) + " "; j=i+1; } } System.out.println(wynik); } } * E &, 0 %1" " % ( 3 %1"$ $ %,# %$2 $ $ "&#( .1%#%*,$%@"$ "%( 3 $ #Q """QQ2222Q$+$ +Q 2 2 2 2"""Q( # - • $ :% %1+# ( • $)" % $ %$%% @""& ( • 3 "$2$$"* $ @""& ( # # import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s1 = in.next(); String s2 = in.next(); String wynik=""; int l1 = s1.length(); int l2 = s2.length(); int min = Math.min(l1, l2); for (int i=0;i<min;i++){ wynik += s1.charAt(i); wynik +=s2.charAt(i); } if (l1>l2) wynik += s1.substring(l2); else wynik += s2.substring(l1); System.out.println(wynik); } ;<078 } * , 82 %1" " ($ :"$" @""&%$ ( %$ ,%1" " $(8 2+#*" , # )$$ ,*)$ % " ( 8 "&$ #=Q2 2QQ $ $ Q,2) $ "%( . 2 $2 %%$$"&"%( ?2 $ + " % $ , * $ + % %"1 2 $# + 5$ ,$ (6 $$ 2 % $1"+$ $ "%( # - % W%W (&56' i # - • .* 1 $ "%)" %"$",$)% • $"$ o %1 1 $ "%)" %"@" ,$%%% o $"$ %$# "&% # - % 2 , $"% 1" , #% 1+ %1 $# #*( # - "$ +$ #,$#_% # #& import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String linia = in.nextLine(); boolean palindrom=true; int i=0; int j=linia.length()-1; while (i<j){ if (linia.charAt(i)==' ') i++; else{ if (linia.charAt(j)==' ')j--; else{ ;D078 palindrom = palindrom && linia.charAt(i)==linia.charAt(j); i++; j--; } } } if (palindrom) System.out.println("Zdanie " + linia + " jest palindromem"); else System.out.println("Zdanie " + linia + " NIE jest palindromem"); } $& & " % %1" 5" 6 ( $ $% $"%, #% $ )$%1"($$ 2 $ $ 1+' ( %)C956,# $ %"$")" $"( " %" $$ $"1"( tekst.indexOf(slowo); $$ 2 1" , " % 1+' ( # #& public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String tekst = in.nextLine(); String slowo = in.next(); int pozycja = tekst.indexOf(slowo); System.out.println(pozycja); } } 1 1 + & 0 %1" $2 $( $ :%$$ 1+(. $ %1" ,%1$%$$ 2%1$% $$ ( 80011308896 1 # -+ 3$ ) "(8 "" "%(9 "&" ( ;/078 * " $$ )( Numer pesel Cyfry numeru PESEL Wagi abcdefghijk a b c 1 3 7 d 9 e 1 f 3 g 7 h 9 i 1 j 3 k x $ $$ 1"$ ) $"&)""$*"&$% ) suma = a*1 + b*3 + c*7 + d*9 + e*1 + f*3 + g*7 + h*9 +i*1 + j*3 ? )$2 +$# k == (10-suma%10)%10 / $ "% $ % $ " %( $ + ) $ # " %""& ) $+2( # -. . *1 $$"& "& 5 "& " 6 * $$ %?-( 82 %1" $$ %% @""& #( ?2 )" + "2) " $ %" ", * %% ?- %+ ?- HH( 3 $ = int i = '3' - '0'; int j = '7' - '0'; // i=3 // i=7 1 . ? , 0 %1" " % # %$#$"($ : #%")#*( $%" ,# @""&)#*(.1 )#*, $ +")( abcdeefs abcdefdgs 6 # -+ 3 * $ ) +, * @""& "& , )" $ 2" , *$ +) *%( <8078