Language: C++

#include<stdio.h>
#include<string.h>
using namespace std;

int main()
{
  int i,j,N;
  int m=0;
  cin >> N;
  char* moji[N][30], tmp[30];
  int* num[N];
  for(i=0;i<N;i++){
    scanf("%s",moji[i]);
    scanf("%d",num[i]);
  }
  for(i=1;i<N;i++){
    for(j=1;j<N;j++){
      if(strcmp(moji[j-1],moji[j])>0){
        strcpy(tmp,moji[j-1]);
        for(int h=1;h<N;h++){
          strcpy(moji[h-1],moji[h]);
        }
        strcpy(moji[N-1],tmp);
      }
      if(strcmp(moji[j-1],moji[j])==0){
        if(num[j-1]<num[j]){
          m=num[j-1];
          num[j-1]=num[j];
          num[j]=m;
        }
      }
    }
    for(i=0;i<N;i++){
      printf("%s%d\n",moji[i],num[i]);
    }
  }
          
      


Compiler output:
a.cc: In function 'int main()':
a.cc:9:3: error: 'cin' was not declared in this scope
    9 |   cin >> N;
      |   ^~~
a.cc:3:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    2 | #include<string.h>
  +++ |+#include <iostream>
    3 | using namespace std;
a.cc:18:25: error: cannot convert 'char**' to 'const char*'
   18 |       if(strcmp(moji[j-1],moji[j])>0){
      |                 ~~~~~~~~^
      |                         |
      |                         char**
In file included from a.cc:2:
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:19:28: error: cannot convert 'char**' to 'const char*'
   19 |         strcpy(tmp,moji[j-1]);
      |                    ~~~~~~~~^
      |                            |
      |                            char**
/usr/include/string.h:141:70: note:   initializing argument 2 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                                               ~~~~~~~~~~~~~~~~~~~~~~~^~~~~
a.cc:21:26: error: cannot convert 'char**' to 'char*'
   21 |           strcpy(moji[h-1],moji[h]);
      |                  ~~~~~~~~^
      |                          |
      |                          char**
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:23:24: error: cannot convert 'char**' to 'char*'
   23 |         strcpy(moji[N-1],tmp);
      |                ~~~~~~~~^
      |                        |
      |                        char**
/usr/include/string.h:141:39: note:   initializing argument 1 of 'char* strcpy(char*, const char*)'
  141 | extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
      |                      ~~~~~~~~~~~~~~~~~^~~~~~
a.cc:25:25: error: cannot convert 'char**' to 'const char*'
   25 |       if(strcmp(moji[j-1],moji[j])==0){
      |                 ~~~~~~~~^
      |                         |
      |                         char**
/usr/include/string.h:156:32: note:   initializing argument 1 of 'int strcmp(const char*, const char*)'
  156 | extern int strcmp (const char *__s1, const char *__s2)
      |                    ~~~~~~~~~~~~^~~~
a.cc:27:20: error: invalid conversion from 'int*' to 'int' [-fpermissive]
   27 |           m=num[j-1];
      |             ~~~~~~~^
      |                    |
      |                    int*
a.cc:29:18: error: invalid conversion from 'int' to 'int*' [-fpermissive]
   29 |           num[j]=m;
      |                  ^
      |                  |
      |                  int
a.cc:36:4: error: expected '}' at end of input
   36 |   }
      |    ^
a.cc:6:1: note: to match this '{'
    6 | {
      | ^