Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package zpliku;
- import java.io.BufferedReader;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.regex.Matcher;
- import java.util.regex.Pattern;
- /**
- *
- * @author Jaro
- */
- public class test2 {
- public static void main(String[] args) throws IOException {
- FileReader fr=new FileReader("X:/gry/kolos.txt");
- BufferedReader br = new BufferedReader(fr);
- String c;
- Pattern p=Pattern.compile("s");
- Pattern p2=Pattern.compile("f");
- while((c=br.readLine())!=null){
- Matcher n=p.matcher(c);
- Matcher m=p2.matcher(c);
- if(n.find()){
- String temp[]=c.split("s");
- for(int i=0;i<temp.length;i++){
- TestSilnia ts = new TestSilnia(Integer.parseInt(temp[i]));
- ts.start();
- }
- }
- if(m.find()){
- String temp[]=c.split("f");
- for(int i=0;i<temp.length;i++){
- TestFibon tf=new TestFibon(Integer.parseInt(temp[i]));
- tf.start();
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment