Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util*;
- public class Ticket{
- public static void main(String arg[]){
- Scanner sc = new Scanner(System.in);
- int tn = sc.nextInt();
- int a, b, c, d, e, f;
- a = tn / 1000000;
- b = tn / 100000 % 10;
- c = tn / 10000 % 10;
- d = tn / 1000 % 10;
- e = tn / 100 % 10;
- f = tn % 10;
- System.out.println (a + b + c + d + e + f);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement