Text Message Formatting

From Progteam

Revision as of 00:24, 7 October 2008 by MuGMaN (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Text Message Formatting
Problem Number 3583
Sorter: Eric
Source: POJ Founder Monthly Contest – 2008.04.13
Link: http://acm.pku.edu.cn/JudgeOnline/problem?id=3583




Text Message Formatting is problem number 3583 on the Peking University ACM site.


Memo

  1. I think this is right, but PKU gives me a run-time error.
  2. Use Queue


import java.util.*;

public class Main1
{

    public static Scanner in;
    public static String[] list = new String[1000];
 
    public static void main(String[] args)
    {
        in=new Scanner(System.in);

        doStuff();
    }

    public static void doStuff()
    {
        String message = in.nextLine();
		int len = message.length();

		String newMessage = "";
		String num = "";

		boolean open = false;
		int count = 0;

	    while(in.hasNext())
		{
	        list[count] = in.next();
			count++;
	    }

		for (int i = 0; i < len; i++)
		{
		    
		}
		
		System.out.println(newMessage);

    }
}
Personal tools