Love丶FFC's Blog
涛涛最近要负责图书馆的管理工作,需要记录下每天读者的到访情况。每位读者有一个编号,每条记录用读者的编号来表示。给出读者的来访记录,请问每一条记录中的读者是第几次出现。
输入的第一行包含一个整数n,表示涛涛的记录条数。
第二行包含n个整数,依次表示涛涛的记录中每位读者的编号。
输出一行,包含n个整数,由空格分隔,依次表示每条记录中的读者编号是第几次出现。
5
1 2 1 1 3
1 1 2 3 1
1≤n≤1,000,读者的编号为不超过n的正整数。
1.从第二个输入的编号开始进行判断。
2.控制输出格式
package CCF_CSP; import java.util.Scanner; public class _20141201_100point { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int[] num = new int[n]; for(int i=0;i<n-1;i++) { int count = 1; //该编号数字首次出现 num[i]=scanner.nextInt(); for(int j=0;j<i;j++) { if(num[j]==num[i]) //该编号再次出现 { count++; } } System.out.print(count+" "); } for(int i=n-1;i<n;i++) //用于输出最后一个数字,控制输出格式 { int count = 1; num[i]=scanner.nextInt(); for(int j=0;j<i;j++) { if(num[j]==num[i]) { count++; } } System.out.print(count); } } }
fruinly
buy cialis usa pralatrexate decreases levels of taurine by unspecified interaction mechanism
engarma
Now you re probably wondering what exactly to take cialis for sale in usa
Preliaf
RANK and RANKL were slightly less compared to control mice, showing that the resorption process in Sp7 Cre; SMS1 f f; SMS2 mice was limited or retarded fincar finasteride online canada
Preliaf
can i buy cialis online Castrellon AB, GlГјck S
sLlGTLon
cialis levitra viagra It works by blocking the activity of certain electrical signals in the heart that can cause an irregular heartbeat