23
三月

程式設計二程式 03/23: ex3

   Posted by: admin   in 103(下)程式設計(二)

import java. io. *;
public class Ex3Class {
 
	public static void main(String[] args) {
		long id;
		id = Long.parseLong(args[]);
		int even = 0;
		int odd = 0;
		//id = 1032245432
		for (int i=0; i< 9; i++)
		{
			if (id %2 ==0)
				even;//even = even + 1;
			else
				odd++;
			id =10;//id = id /10;
		}
		// TODO Auto-generated method stub
		System.out.printf("Even= %d Odd = %d", even, odd);
	}
 
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,

This entry was posted on 星期一, 三月 23rd, 2015 at 09:48:42 and is filed under 103(下)程式設計(二). You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment