Petya loves football very much. One day, as he was watching a football match, he was writing the players’ current positions on a piece of paper. To simplify the situation he depicted it as a string consisting of zeroes and ones. A zero corresponds to players of one team; a one corresponds to players of another team. If there are at least 7 players of some team standing one after another, then the situation is considered dangerous. For example, the situation 00100110111111101 is dangerous and 11110111011101 is not. You are given the current situation. Determine whether it is dangerous or not.
Input
The first input line contains a non-empty string consisting of characters “0” and “1”, which represents players. The length of the string does not exceed 100 characters. There’s at least one player from each team present on the field.
Output
Print “YES” if the situation is dangerous. Otherwise, print “NO”.
Examples
Input
001001
Output
NO
Input
1000000001
Output
YES
代码
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
String str=in.nextLine();
int sum=1;
if(str.length()<7){
System.out.println("NO");
return;
}
else{
for(int i=0;i<str.length()-1;i++){
if(str.charAt(i)==str.charAt(i+1))
sum+=1;
else
sum=1;
while(sum==7){
System.out.println("YES");
return;
}
}
System.out.println("NO");
}
}
}
Petya started to attend programming lessons. On the first lesson his task was to write a simple program. The program was supposed to do the following: in the given string, consisting if uppercase and lowercase Latin letters, it:
deletes all the vowels,
inserts a character “.” before each consonant,
replaces all uppercase consonants with corresponding lowercase ones.
Vowels are letters “A”, “O”, “Y”, “E”, “U”, “I”, and the rest are consonants. The program’s input is exactly one string, it should return the output as a single string, resulting after the program’s processing the initial string.
Help Petya cope with this easy task.
Input
The first line represents input string of Petya’s program. This string only consists of uppercase and lowercase Latin letters and its length is from 1 to 100, inclusive.
Output
Print the resulting string. It is guaranteed that this string is not empty.
Examples
Input
tour
Output
.t.r
Input
Codeforces
Output
.c.d.f.r.c.s
Input
aBAcAba
Output
.b.c.b
代码(错误!!未找到错误原因)
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
String str=in.nextLine();
str=str.toLowerCase();//字符全部转小写
StringBuilder sb = new StringBuilder(str);//构造一个StringBuilder对象
for(int i=0;i
3、Restaurant(按结束时间排序)【java自定义结构体排序】
A restaurant received n orders for the rental. Each rental order reserve the restaurant for a continuous period of time, the i-th order is characterized by two time values — the start time li and the finish time ri (li ≤ ri).
Restaurant management can accept and reject orders. What is the maximal number of orders the restaurant can accept?
No two accepted orders can intersect, i.e. they can’t share even a moment of time. If one order ends in the moment other starts, they can’t be accepted both.
Input
The first line contains integer number n (1 ≤ n ≤ 5·105) — number of orders. The following n lines contain integer values li and ri each (1 ≤ li ≤ ri ≤ 109).
Output
Print the maximal number of orders that can be accepted.
Examples
Input
2
7 11
4 7
Output
1
Input
5
1 2
2 3
3 4
4 5
5 6
Output
3
Input
6
4 8
1 5
4 7
2 5
1 3
6 8
Output
2
import java.util.*;
class p{
int x,y;//开始时间和结束时间
}//希望用类似结构体的类实现数组功能
class mycmp implements Comparator<p>{
/* Comparator强行对某个对象collection进行整体排序的比较函数,可以将Comparator传递给Collections.sort或Arrays.sort。
接口方法: @return o1小于、等于或大于o2,分别返回负整数、零或正整数。
int compare(Object o1, Object o2);
*/
public int compare(p A,p B)
{
return A.y-B.y; //按照结束时间先后排序,==这一步很重要!!!==
}
}
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
int n=in.nextInt();
//p a=new p();//a为声明的结构体
p[] arr=new p[n];
for(int i=0;i<n;i++)
{ arr[i]=new p();
arr[i].x=in.nextInt();
arr[i].y=in.nextInt();
}//初始化
Arrays.sort(arr,new mycmp());//按照结束时间先后排序
int sum=1;
int mo=arr[0].y;
for(int i=1;i<n;i++){
while(arr[i].x>mo){
mo=arr[i].y;
sum++;
}
}
for(int i=0;i<n;i++){
System.out.println(arr[i].y);
}//可以看到自己排序后的结果
System.out.println(sum);
}}
4、Fox and Number Game
Fox Ciel is playing a game with numbers now.
Ciel has n positive integers: x1, x2, …, xn. She can do the following operation as many times as needed: select two different indexes i and j such that xi > xj hold, and then apply assignment xi = xi - xj. The goal is to make the sum of all numbers as small as possible.
Please help Ciel to find this minimal sum.
Input
The first line contains an integer n (2 ≤ n ≤ 100). Then the second line contains n integers: x1, x2, …, xn (1 ≤ xi ≤ 100).
Output
Output a single integer — the required minimal sum.
Examples
Input
2
1 2
Output
2
Input
3
2 4 6
Output
6
Input
2
12 18
Output
12
Input
5
45 12 27 30 18
Output
15
Note
In the first example the optimal way is to do the assignment: x2 = x2 - x1.
In the second example the optimal sequence of operations is: x3 = x3 - x2, x2 = x2 - x1.
import java.util.*;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int[] arr=new int[n];
for(int i=0;i<n;i++)
{
arr[i]=in.nextInt();
}//初始化
Arrays.sort(arr);//按照先后排序
if(n<=1){
System.out.println(arr[0]);}
else{
while(arr[n-1]!=arr[0]){
for(int i=n-1;i>=0;i--){
if(arr[i]<arr[n-1])
arr[n-1]=arr[n-1]-arr[i];
//从后往前找比最后一个小的数,减后的数赋值给arr[n-1],再次按大小排序
}
Arrays.sort(arr);
}
System.out.println(n*arr[0]);
}
}}
5、Liebig’s Barrels
You have m = n·k wooden staves. The i-th stave has length ai. You have to assemble n barrels consisting of k staves each, you can use any k staves to construct a barrel. Each stave must belong to exactly one barrel.
Let volume vj of barrel j be equal to the length of the minimal stave in it.
You want to assemble exactly n barrels with the maximal total sum of volumes. But you have to make them equal enough, so a difference between volumes of any pair of the resulting barrels must not exceed l, i.e. |vx - vy| ≤ l for any 1 ≤ x ≤ n and 1 ≤ y ≤ n.
Print maximal total sum of volumes of equal enough barrels or 0 if it’s impossible to satisfy the condition above.
Input
The first line contains three space-separated integers n, k and l (1 ≤ n, k ≤ 105, 1 ≤ n·k ≤ 105, 0 ≤ l ≤ 109).
The second line contains m = n·k space-separated integers a1, a2, …, am (1 ≤ ai ≤ 109) — lengths of staves.
Output
Print single integer — maximal total sum of the volumes of barrels or 0 if it’s impossible to construct exactly n barrels satisfying the condition |vx - vy| ≤ l for any 1 ≤ x ≤ n and 1 ≤ y ≤ n.
Examples
Input
4 2 1
2 2 1 2 3 2 2 3
Output
7
Input
2 1 0
10 10
Output
20
Input
1 2 1
5 2
Output
2
Input
3 2 1
1 2 3 4 5 6
Output
0
import java.util.*;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int k=in.nextInt();
int l=in.nextInt();
int pre=0;
int flag=0;
int[] arr=new int[n*k];
for(int i=0;i<n*k;i++)
{
arr[i]=in.nextInt();
}
Arrays.sort(arr);//按照先后排序
if(arr[n-1]-arr[0]>l)
{
System.out.println("0");
}
else{
for(int i=n*k-1;i>=0;i--)
{
if(arr[i]-arr[0]<=l){//(是L不是1),找到满足条件最大的数flag
flag=i;
break;
}
}
//System.out.println(flag);
int sum=arr[flag];
int p=flag;
// int m=n*k-1-flag;
// if(m>=k-1){
// for(int h=0;h
// sum+=arr[flag--];
// pre++;//从后往前取的有pre个
// }
// }
for(int i=n*k-1;i-(k-1)>flag;i=i-(k-1)){
sum+=arr[p--];
pre++;
}
for(int a=0;a<flag-pre;a=a+k)
{
sum+=arr[a];
}
System.out.println(sum);
}
}}
6、Repeatless Numbers (深度优先遍历,回溯)
A repeatless number is a positive integer containing no repeated digits. For instance, the first 25 repeatless numbers are
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24, 25, 26, 27, …
Given an integer n, your goal is to compute the nth repeatless number.
Input
The input test file will contain multiple test cases, each consisting of a single line containing the integer n, where 1 ≤ n ≤ 1000000. The end-of-file is marked by a test case with n = 0 and should not be processed.
Output
For each input case, the program should print the nth repeatless number on a single line.
Sample Input
25
10000
0
Sample Output
27
26057
import java.util.*;
public class Main {
static int[] arr=new int[10000000];
static Boolean[] digMap=new Boolean[10];
static int n=0;
//相当于全局变量吧?
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
for(int i=0;i<10;i++){
digMap[i]=true;
}
dfs(0,0,0);
while(in.hasNext()){
int m=in.nextInt();
if(m==0)
return;
else{
System.out.println(arr[m]);
}}
}
public static void dfs(int num,int digit,int flag){
//参数表中num数字的值 num枚举到第几位了,0是否可以占位使用
//如果flag为1位0不能占位使用 0时反之
if(n>10000000){
//如果n大于最大值就不要继续打表了 跳出函数
return;
}
if(digit==8){
//当位数等于8时找到一个8位(因为我们要打表到max,max为8位)的没有重复位的数
a[n++] = nowNum;
arr[n++]=num;
//第n个符合要求的数
return;
}
for(int i=0;i<10;i++){
//遍历0-9十个数字在当前位上的情况
if(i==0&&flag==0){
//如果该位为0且0可以继续站位使用
dfs(0,digit+1,0);
}else{
if(digMap[i]){
//如果这数还没被用过
digMap[i]=false;
dfs(num*10+i,digit+1,1);
digMap[i]=true;
//又把该数标记为没用过,继续遍历(回溯)
}
}
}
}
}
7、万古留芳(1)
把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。
Input
第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。
Output
对输入的每组数据M和N,用一行输出相应的K。
Sample Input
1
7 3
Sample Output
8
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
int[][] arr=new int[15][15];
int num=in.nextInt();
for(int i=0;i<num;i++){
int a=in.nextInt();
int b=in.nextInt();
System.out.println(Apple(a,b));
}
}
public static int Apple(int n,int m){
if(n<0) return 0;
if(n==0||m==1) return 1;
return (Apple(n,m-1)+Apple(n-m,m));//有0和无0
}
}
8、Number Sequence (超时,应该是循环的)
number sequence is defined as follows:
f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7.
Given A, B, and n, you are to calculate the value of f(n).
Input
The input consists of multiple test cases. Each test case contains 3 integers A, B and n on a single line (1 <= A, B <= 1000, 1 <= n <= 100,000,000). Three zeros signal the end of input and this test case is not to be processed.
Output
For each test case, print the value of f(n) on a single line.
Sample Input
1 1 3
1 2 10
0 0 0
Sample Output
2
5
import java.util.*;
public class Main {
public static void main(String[] args) {
// TODO Auto-generated method stub
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
while(in.hasNext()){
int A=in.nextInt();
int B=in.nextInt();
int n=in.nextInt();
if(A==0&&B==0&&n==0)
return;
else{
System.out.println(f(A,B,n));
}
}
}
public static int f(int A,int B,int n){
if(n==1)return 1;
if(n==2)return 1;
return((A*f(A,B,n-1)+ B*f(A,B,n-2))%7);
}
}
9、Mishka and Contest
Mishka started participating in a programming contest. There are n problems in the contest. Mishka’s problem-solving skill is equal to k.
Mishka arranges all problems from the contest into a list. Because of his weird principles, Mishka only solves problems from one of the ends of the list. Every time, he chooses which end (left or right) he will solve the next problem from. Thus, each problem Mishka solves is either the leftmost or the rightmost problem in the list.
Mishka cannot solve a problem with difficulty greater than k. When Mishka solves the problem, it disappears from the list, so the length of the list decreases by 1. Mishka stops when he is unable to solve any problem from any end of the list.
How many problems can Mishka solve?
Input
The first line of input contains two integers n and k (1≤n,k≤100) — the number of problems in the contest and Mishka’s problem-solving skill.
The second line of input contains n integers a1,a2,…,an (1≤ai≤100), where ai is the difficulty of the i-th problem. The problems are given in order from the leftmost to the rightmost in the list.
Output
Print one integer — the maximum number of problems Mishka can solve.
Examples
Input
8 4
4 2 3 1 5 1 6 4
Output
5
Input
5 2
3 1 2 1 3
Output
0
Input
5 100
12 34 55 43 21
Output
5
Note
In the first example, Mishka can solve problems in the following order: [4,2,3,1,5,1,6,4]→[2,3,1,5,1,6,4]→[2,3,1,5,1,6]→[3,1,5,1,6]→[1,5,1,6]→[5,1,6], so the number of solved problems will be equal to 5.
In the second example, Mishka can’t solve any problem because the difficulties of problems from both ends are greater than k.
In the third example, Mishka’s solving skill is so amazing that he can solve all the problems.
import java.util.*;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
int n=in.nextInt();
int k=in.nextInt();
int[] arr=new int[n];
int num=0;
int m;
for(int i=0;i<n;i++){
arr[i]=in.nextInt();
}
for(m=0;m<n;m++){
if(arr[m]<=k){
num++;
}
else
break;
}
for(int j=n-1;j>m;j--){
if(arr[j]<=k){
num++;
}
else
break;
}
System.out.println(num);
}}
10、 Two Buttons (BFS、队列)
Vasya has found a strange device. On the front panel of a device there are: a red button, a blue button and a display showing some positive integer. After clicking the red button, device multiplies the displayed number by two. After clicking the blue button, device subtracts one from the number on the display. If at some point the number stops being positive, the device breaks down. The display can show arbitrarily large numbers. Initially, the display shows number n.
Bob wants to get number m on the display. What minimum number of clicks he has to make in order to achieve this result?
Input
The first and the only line of the input contains two distinct integers n and m (1 ≤ n, m ≤ 104), separated by a space .
Output
Print a single number — the minimum number of times one needs to push the button required to get the number m out of number n.
Examples
Input
4 6
Output
2
Input
10 1
Output
9
Note
In the first example you need to push the blue button once, and then push the red button once.
In the second example, doubling the number is unnecessary, so we need to push the blue button nine times.
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
while(in.hasNext()){
int n=in.nextInt();
int m=in.nextInt();
boolean vis[]=new boolean[10005];
Node a=new Node(n,0);//初始数n作为start传入,此时time为0
Queue<Node> q=new LinkedList<Node>();//队列,数据类型为Node
q.offer(a);//a放入队列
while(!q.isEmpty()){
a=q.poll();//从队列中删除
if(vis[a.start])continue;
if(a.start==m){
System.out.print(a.time);
break;
}
vis[a.start]=true;
a.time++;
Node A=new Node(a),B=new Node(a);//A,B是两种操作,初始值和a相同
A.start--;
B.start*=2;
if(A.start>0&&!vis[A.start]){
q.offer(A);
}//如果A.start为正整数 并且未被标记为true的时候 就把A.START--的值插入队列
if(B.start<=10000&&!vis[B.start]){
q.offer(B);
}
}
}
}
}
class Node{
int start;
int time;
public Node(Node a){
start=a.start;
time=a.time;
}
public Node(int s,int t){
start=s;
time=t;
}
}
代码思考
vis数组作用: 默认初始化就是false,当操作过程产生某一个数,并用这个数更新start后就标记为true。比如后面的判断A.start>0&&!vis[A.start],这个vis可以判断这个start在操作中是否出现,如果出现过就不需要赋值给start了,避免重复。
结合需求看这段代码:
减一和乘二在需求中是要作为条件的,要算上这些条件得出n到m的次数,所以减一和乘二之后会被放入队列中。
一直到a.start等于m的时候 这个数字会被打印出来,循环终止。
整个循环都是在循环这个队列,在循环的过程中一直有值被丢到这个队列,丢进去的值是向m靠拢的,已经在里面的值就不用再放了。
a=q.poll();
这一句话 会把队列首位的值取出来,然后删掉这个值 。
直到得到m,输出time。
11、H - Soldier and Cards
Two bored soldiers are playing card war. Their card deck consists of exactly n cards, numbered from 1 to n, all values are different. They divide cards between them in some manner, it’s possible that they have different number of cards. Then they play a “war”-like card game.
The rules are following. On each turn a fight happens. Each of them picks card from the top of his stack and puts on the table. The one whose card value is bigger wins this fight and takes both cards from the table to the bottom of his stack. More precisely, he first takes his opponent’s card and puts to the bottom of his stack, and then he puts his card to the bottom of his stack. If after some turn one of the player’s stack becomes empty, he loses and the other one wins.
You have to calculate how many fights will happen and who will win the game, or state that game won’t end.
Input
First line contains a single integer n (2 ≤ n ≤ 10), the number of cards.
Second line contains integer k1 (1 ≤ k1 ≤ n - 1), the number of the first soldier’s cards. Then follow k1 integers that are the values on the first soldier’s cards, from top to bottom of his stack.
Third line contains integer k2 (k1 + k2 = n), the number of the second soldier’s cards. Then follow k2 integers that are the values on the second soldier’s cards, from top to bottom of his stack.
All card values are different.
Output
If somebody wins in this game, print 2 integers where the first one stands for the number of fights before end of game and the second one is 1 or 2 showing which player has won.
If the game won’t end and will continue forever output - 1.
Examples
Input
4
2 1 3
2 4 2
Output
6 2
Input
3
1 2
2 1 3
Output
-1
Note
First sample:
Second sample:
暴力解法
import java.util.*;
public class Main {
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
Queue<Integer> q1=new LinkedList<Integer>();
Queue<Integer> q2=new LinkedList<Integer>();
@SuppressWarnings("unused")
int n=in.nextInt();
int k1=in.nextInt();
int[] arr=new int[k1];
for(int i=0;i<k1;i++){
arr[i]=in.nextInt();
q1.offer(arr[i]);
}
int k2=in.nextInt();
int[] brr=new int[k2];
for(int i=0;i<k2;i++){
brr[i]=in.nextInt();
q2.offer(brr[i]);
}
int num=0;
while(!q1.isEmpty()&&!q2.isEmpty()){
if(num>10000000){
System.out.println(-1);
break;
}
num++;
int x=q1.element();
q1.poll();
int y=q2.element();
q2.poll();
if(x>y){
q1.offer(y);
q1.offer(x);
}
if(x<y){
q2.offer(x);
q2.offer(y);
}
}
if(q1.isEmpty()||q2.isEmpty()){
if(q1.isEmpty()){
System.out.println(num+" "+2);
}
else{
System.out.println(num+" "+1);
}
}
}}
12.Maze
Pavel loves grid mazes. A grid maze is an n × m rectangle maze where each cell is either empty, or is a wall. You can go from one cell to another only if both cells are empty and have a common side.
Pavel drew a grid maze with all empty cells forming a connected area. That is, you can go from any empty cell to any other one. Pavel doesn’t like it when his maze has too little walls. He wants to turn exactly k empty cells into walls so that all the remaining cells still formed a connected area. Help him.
Input
The first line contains three integers n, m, k (1 ≤ n, m ≤ 500, 0 ≤ k < s), where n and m are the maze’s height and width, correspondingly, k is the number of walls Pavel wants to add and letter s represents the number of empty cells in the original maze.
Each of the next n lines contains m characters. They describe the original maze. If a character on a line equals “.”, then the corresponding cell is empty and if the character equals “#”, then the cell is a wall.
Output
Print n lines containing m characters each: the new maze that fits Pavel’s requirements. Mark the empty cells that you transformed into walls as “X”, the other cells must be left without changes (that is, “.” and “#”).
It is guaranteed that a solution exists. If there are multiple solutions you can output any of them.
Examples
Input
3 4 2
#…#
…#.
#…
Output
#.X#
X.#.
#…
Input
5 4 5
#…
#.#.
.#…
…#
.#.#
Output
#XXX
#X#.
X#…
…#
.#.#
Java代码报错了>
import java.util.*;
public class Main {
private static boolean[][] vis=new boolean[502][502];
private static char[][] map=new char[502][502];
private static int k;
private static int n;
private static int m;
private static int dire[][]={{0,1},{0,-1},{-1,0},{1,0}};//左,右,下,上
public static void main(String[] args) {
@SuppressWarnings("resource")
Scanner in=new Scanner(System.in);
while(in.hasNext()){
n=in.nextInt();
m=in.nextInt();
k=in.nextInt();
for(int i=0;i<=n;i++){
String line=in.nextLine();
//System.out.println(line);
for(int j=0;j<line.toString().length();j++){
map[i][j]=line.charAt(j);//如果使用nextLine()可以使用charAt(index)分开每个字符。
vis[i][j]=false;
}
}
for(int h=1;h<=n;h++){
for(int r=1;r<=m;r++){
if(!vis[h][r]&&map[h][r]!='#'){
vis[h][r]=true;
Dfs(h,r);
vis[h][r]=false;
}
}
}
for(int h1=0;h1<=n;h1++){
for(int r=0;r<=m;r++){
System.out.print(map[h1][r]);
}
System.out.println();
}
}
}
private static void Dfs(int x,int y){
if(k==0)return;
for(int i=0;i<4;i++){
int nx=x+dire[i][0];
int ny=y+dire[i][1];
if(nx<1||nx>n||ny<1||ny>m)continue;
if(!vis[nx][ny]&&map[nx][ny]=='.'){
vis[nx][ny]=true;
Dfs(nx,ny);
//vis[nx][ny]=false;//回溯过程中变为墙
if(k>0)
{
map[nx][ny]='X';
k--;
}
}
}
}
}
C++AC代码
#include<iostream>
#include<cstring>
using namespace std;
int n,m,k;
int book[502][502];
char map[502][502];
int dire[4][2]={-1,0,1,0,0,-1,0,1};
void dfs(int x,int y)
{
if(k==0) return;
for(int i=0;i<4;i++)
{
int nx=x+dire[i][0];
int ny=y+dire[i][1];
if(nx<1||nx>n||ny<1||ny>m)continue;
if(!book[nx][ny]&&map[nx][ny]=='.')
{
book[nx][ny]=1;
dfs(nx,ny);
book[nx][ny]=0;
if(k)
{
map[nx][ny]='X';
k--;
}
}
}
}
int main()
{
while(cin>>n>>m>>k)
{
memset(book,0,sizeof(book));
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
{
cin>>map[i][j];
}
for(int i=1;i<=n;i++)
for(int j=1;j<=m;j++)
{
if(!book[i][j]&&map[i][j]!='#')
{
book[i][j]=1;
dfs(i,j);
book[i][j]=0;
}
}
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
cout<<map[i][j];
cout<<endl;
}
}
return 0;
}
你可能感兴趣的:(我的代码)