<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-912045694561635906</id><updated>2011-04-21T15:19:21.235-07:00</updated><title type='text'>Chelinoska's blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://chelinoska.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/912045694561635906/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://chelinoska.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>chelinoska</name><uri>http://www.blogger.com/profile/05339884841053445514</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-912045694561635906.post-7444436854630530774</id><published>2009-03-14T20:27:00.000-07:00</published><updated>2009-03-16T17:49:33.063-07:00</updated><title type='text'>Sheep.java</title><content type='html'>&lt;pre&gt;&lt;span&gt;&lt;span class="asciiart"&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;tamw;&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;tamw;&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;tamd;&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;tamd;&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;import java.util.Scanner;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;/**&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt; *&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt; * @author Chelinoska&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt; */&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;class Contador{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    Scanner in = new Scanner (System.in);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public String[] word;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public int tamw;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public int cases;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public Contador(int tamw){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    this.tamw = tamw;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    word= new String[tamw];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    cases=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    this.Leer();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    this.Calcular();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public void Leer(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        for(int i=0; i&lt;tamw;&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            this.word[i]=in.next();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public void Calcular(){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        for(int i=0; i&lt;tamw;&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            if(this.word[i].equals("sheep")){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            this.cases=this.cases+1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;class Sheep{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    public static void main(String []args){&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        Scanner in= new Scanner(System.in);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        int tamd=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        int tamw=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        int a=0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        tamd=in.nextInt();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        Contador[] data= new Contador[tamd];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        for(int i=0; i&lt;tamd;&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            tamw= in.nextInt();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            data[i]= new Contador(tamw);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        for(int i=0; i&lt;tamd;&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            a=i+1;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;            System.out.println("Case "+a+": This list contains "+data[i].cases+" sheep");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 255, 255);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;/tamd;&gt;&lt;/span&gt;&lt;/tamd;&gt;&lt;/span&gt;&lt;/tamw;&gt;&lt;/span&gt;&lt;/tamw;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/912045694561635906-7444436854630530774?l=chelinoska.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://chelinoska.blogspot.com/feeds/7444436854630530774/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://chelinoska.blogspot.com/2009/03/ascii-d.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/912045694561635906/posts/default/7444436854630530774'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/912045694561635906/posts/default/7444436854630530774'/><link rel='alternate' type='text/html' href='http://chelinoska.blogspot.com/2009/03/ascii-d.html' title='Sheep.java'/><author><name>chelinoska</name><uri>http://www.blogger.com/profile/05339884841053445514</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
