Advertisement
Randomsurpriseguy

ZykelAnfänge

Jan 10th, 2018
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.00 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. class ZEl{
  4.     int Stelle;
  5.     boolean Covered;
  6. }
  7.  
  8. public class Zykel {
  9.    
  10.     static Scanner sc=new Scanner(System.in);
  11.    
  12.     public static void P(String P) {
  13.         System.out.println(P);
  14.     }
  15.     public static ZEl ZEl(int a) {
  16.         ZEl Out=new ZEl();
  17.         Out.Stelle=a;
  18.         Out.Covered=false;
  19.         return Out;
  20.     }
  21.    
  22.     public static int StringzuInt(String In) {
  23.         int c=In.length()-1;
  24.         int Out=0;
  25.         while (c>=0) {
  26.            
  27.            
  28.         }
  29.     }
  30.    
  31.     public static int[] Zykelreturn(String In) {
  32.         In=In.replaceAll(" ", "");
  33.         int c=0;
  34.         int k=0;
  35.         int Kommata=0;
  36.         while (c<In.length()) {
  37.             if (In.charAt(c)==',') {
  38.                 Kommata++;
  39.             }
  40.             c++;
  41.         }
  42.         P(""+Kommata);
  43.         c=0;
  44.         int z=0;
  45.         ZEl Out[]=new ZEl[Kommata];
  46.         while (c<In.length()) {
  47.             k=c;
  48.             while(In.charAt(c)!=',') {
  49.                 c++;
  50.             }
  51.             Out[z]=ZEl(StringzuInt(In.substring(k,c)));
  52.             c+=2;
  53.         }
  54.         return Out;
  55.     }
  56.    
  57.     public static void main(String[] args) {
  58.         // TODO Auto-generated method stub
  59.         Zykelreturn("1,1,2,1,3");
  60.     }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement