Language: C++

Last login: Mon Mar 16 20:11:35 on console
Prabhakars-MBP:~ pavani$ g++
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
Prabhakars-MBP:~ pavani$ g++
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
Prabhakars-MBP:~ pavani$ g++
xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
Prabhakars-MBP:~ pavani$ vim index.html
Prabhakars-MBP:~ pavani$ cd Desktop
Prabhakars-MBP:Desktop pavani$ cd test
-bash: cd: test: No such file or directory
Prabhakars-MBP:Desktop pavani$ mkdir test
Prabhakars-MBP:Desktop pavani$ vim index.html
Prabhakars-MBP:Desktop pavani$ vim index.html
Prabhakars-MBP:Desktop pavani$ cd --
Prabhakars-MBP:~ pavani$ cd Documents
Prabhakars-MBP:Documents pavani$ cd iss
Prabhakars-MBP:iss pavani$ vim index.html
Prabhakars-MBP:iss pavani$ vim game.html
Prabhakars-MBP:iss pavani$ vim game.html
Prabhakars-MBP:iss pavani$ gedit game.html
-bash: gedit: command not found
Prabhakars-MBP:iss pavani$ cd --
Prabhakars-MBP:~ pavani$ cd test
-bash: cd: test: No such file or directory
Prabhakars-MBP:~ pavani$ cd Desktop
Prabhakars-MBP:Desktop pavani$ cd test
Prabhakars-MBP:test pavani$ vim lol
Prabhakars-MBP:test pavani$ vim lol.cpp
Prabhakars-MBP:test pavani$ cp lol lol.cpp
Prabhakars-MBP:test pavani$ vim lol.cpp
Prabhakars-MBP:test pavani$ g++ lol.cpp
lol.cpp:4:1: error: use of undeclared identifier 'cout'; did you mean
      'std::cout'?
cout<<"Hi"<<endl;
^~~~
std::cout
/Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:54:33: note: 
      'std::cout' declared here
extern _LIBCPP_FUNC_VIS ostream cout;
                                ^
lol.cpp:4:13: error: use of undeclared identifier 'endl'; did you mean
      'std::endl'?
cout<<"Hi"<<endl;
            ^~~~
            std::endl
/Library/Developer/CommandLineTools/usr/include/c++/v1/ostream:999:1: note: 
      'std::endl' declared here
endl(basic_ostream<_CharT, _Traits>& __os)
^
2 errors generated.
Prabhakars-MBP:test pavani$ vim lol.cpp
Prabhakars-MBP:test pavani$ g++ lol.cpp
Prabhakars-MBP:test pavani$ ./a.out
Hi
Prabhakars-MBP:test pavani$ cd --
Prabhakars-MBP:~ pavani$ cd Downloads 
Prabhakars-MBP:Downloads pavani$ cd CintaKamu-master
Prabhakars-MBP:CintaKamu-master pavani$ cd Code 
Prabhakars-MBP:Code pavani$ vim Pavani315.cpp
Prabhakars-MBP:Code pavani$ 
  [Restored 09-Apr-2020 at 5:55:33 PM]
Last login: Thu Apr  9 17:55:26 on console
Prabhakars-MacBook-Pro:Code pavani$ 
  [Restored 10-Apr-2020 at 10:45:41 PM]
Last login: Fri Apr 10 22:45:36 on console
Restored session: Fri Apr 10 10:46:51 IST 2020
Prabhakars-MacBook-Pro:Code pavani$ 
  [Restored 12-Apr-2020 at 3:00:55 PM]
Last login: Sun Apr 12 15:00:49 on console
Restored session: Sat Apr 11 01:28:36 IST 2020
Prabhakars-MacBook-Pro:Code pavani$ 
  [Restored 13-Apr-2020 at 5:34:37 PM]
Last login: Mon Apr 13 17:34:31 on console
Prabhakars-MacBook-Pro:Code pavani$ 
  [Restored 16-Apr-2020 at 3:12:26 AM]
Last login: Wed Apr 15 23:38:08 on console
Restored session: Tue Apr 14 23:21:28 IST 2020
Prabhakars-MacBook-Pro:Code pavani$ 
  [Restored 17-Apr-2020 at 10:05:19 PM]
Last login: Fri Apr 17 22:05:15 on console
Restored session: Thu Apr 16 10:43:44 IST 2020
Prabhakars-MacBook-Pro:Code pavani$ 
  [Restored 26-Apr-2020 at 6:00:19 PM]
Last login: Sun Apr 26 15:45:36 on console
Restored session: Sat Apr 18 20:32:41 IST 2020
Prabhakars-MacBook-Pro:Code pavani$ vim lol.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol.cpp
lol.cpp:22:3: error: expected unqualified-id
  for(auto &s : stringArray) {
  ^
lol.cpp:36:8: error: no type named 'cout' in namespace 'std'
  std::cout << unique_count << std::endl;
  ~~~~~^
lol.cpp:36:13: error: expected unqualified-id
  std::cout << unique_count << std::endl;
            ^
lol.cpp:37:1: error: extraneous closing brace ('}')
}
^
4 errors generated.
Prabhakars-MacBook-Pro:Code pavani$ vim lol.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol.cpp
lol.cpp:9:3: error: use of undeclared identifier 'cin'; did you mean 'std::cin'?
  cin>>n;
  ^~~
  std::cin
/Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:50:33: note: 
      'std::cin' declared here
extern _LIBCPP_FUNC_VIS istream cin;
                                ^
lol.cpp:10:3: error: unknown type name 'string'; did you mean 'std::string'?
  string stringArray[n];// = { "Tommy", "Sammy", "Tommy", "Wally", "Tommy" };
  ^~~~~~
  std::string
/Library/Developer/CommandLineTools/usr/include/c++/v1/iosfwd:194:65: note: 
      'std::string' declared here
typedef basic_string<char, char_traits<char>, allocator<char> > string;
                                                                ^
lol.cpp:11:3: error: unknown type name 'string'; did you mean 'std::string'?
  string st;
  ^~~~~~
  std::string
/Library/Developer/CommandLineTools/usr/include/c++/v1/iosfwd:194:65: note: 
      'std::string' declared here
typedef basic_string<char, char_traits<char>, allocator<char> > string;
                                                                ^
lol.cpp:14:5: error: use of undeclared identifier 'cin'; did you mean
      'std::cin'?
    cin>>st;
    ^~~
    std::cin
/Library/Developer/CommandLineTools/usr/include/c++/v1/iostream:50:33: note: 
      'std::cin' declared here
extern _LIBCPP_FUNC_VIS istream cin;
                                ^
lol.cpp:19:12: error: use of undeclared identifier 'string'
  std::map<string, int> count_find;
           ^
lol.cpp:22:3: error: expected unqualified-id
  for(auto &s : stringArray) {
  ^
lol.cpp:36:8: error: no type named 'cout' in namespace 'std'
  std::cout << unique_count << std::endl;
  ~~~~~^
lol.cpp:36:13: error: expected unqualified-id
  std::cout << unique_count << std::endl;
            ^
lol.cpp:37:1: error: extraneous closing brace ('}')
}
^
9 errors generated.
Prabhakars-MacBook-Pro:Code pavani$ vim lol.cpp
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:13:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:13:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ ./a.out
2, 3
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:13:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:13:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:13:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:13:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:23:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ ./a.out
3
apple
orange
apple
1, 2
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:23:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ ./a.out
3
apple
orange
apple
1
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp

lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:23:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ 
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:23:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
lol1.cpp:38:16: error: use of undeclared identifier 'unique_countk'; did you
      mean 'unique_count'?
  std::cout << unique_countk  << std::endl;
               ^~~~~~~~~~~~~
               unique_count
lol1.cpp:21:29: note: 'unique_count' declared here
  int non_unique_count = 0, unique_count = 0;
                            ^
2 warnings and 1 error generated.
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:23:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
lol1.cpp:38:29: error: use of undeclared identifier 'k'
  std::cout << unique_count+k  << std::endl;
                            ^
2 warnings and 1 error generated.
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:24:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:24:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ ./a.out
3
orange
apple
apple
2
Prabhakars-MacBook-Pro:Code pavani$ ./a.out
4
aaaa
a
aaa
aa
4
Prabhakars-MacBook-Pro:Code pavani$ g++ lol1.cpp
lol1.cpp:24:7: warning: 'auto' type specifier is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
      ^
lol1.cpp:24:15: warning: range-based for loop is a C++11 extension
      [-Wc++11-extensions]
  for(auto &s : stringArray) {
              ^
2 warnings generated.
Prabhakars-MacBook-Pro:Code pavani$ ./a.out
5
grape
grape
grape
grape
grape
1
Prabhakars-MacBook-Pro:Code pavani$ vim lol1.cpp

#include <iostream>
#include <string>
#include <map>
using namespace std;

int main()
{
int n;
scanf("%d", &n);
  string stringArray[n];
// = { "Tommy", "Sammy", "Tommy", "Wally", "Tommy" };
int k=0;
for(int i=0;i<n;i++)
{
string st;
cin>>st;
stringArray[i] = st;
}


  std::map<string, int> count_find;
  int non_unique_count = 0, unique_count = 0;

"lol1.cpp" 40L, 1071C


Compiler output:
a.cc:3:54: warning: multi-character literal with 23 characters exceeds 'int' size of 4 bytes
    3 | xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:5:54: warning: multi-character literal with 23 characters exceeds 'int' size of 4 bytes
    5 | xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:7:54: warning: multi-character literal with 23 characters exceeds 'int' size of 4 bytes
    7 | xcode-select: note: no developer tools were found at '/Applications/Xcode.app', requesting install. Choose an option in the dialog to download the command line developer tools.
      |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:33:50: warning: multi-character character constant [-Wmultichar]
   33 | lol.cpp:4:1: error: use of undeclared identifier 'cout'; did you mean
      |                                                  ^~~~~~
a.cc:34:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   34 |       'std::cout'?
      |       ^~~~~~~~~~~
a.cc:39:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   39 |       'std::cout' declared here
      |       ^~~~~~~~~~~
a.cc:42:51: warning: multi-character character constant [-Wmultichar]
   42 | lol.cpp:4:13: error: use of undeclared identifier 'endl'; did you mean
      |                                                   ^~~~~~
a.cc:43:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   43 |       'std::endl'?
      |       ^~~~~~~~~~~
a.cc:48:7: warning: multi-character literal with 9 characters exceeds 'int' size of 4 bytes
   48 |       'std::endl' declared here
      |       ^~~~~~~~~~~
a.cc:62:13: error: invalid digit "9" in octal constant
   62 |   [Restored 09-Apr-2020 at 5:55:33 PM]
      |             ^~
a.cc:77:30: error: invalid digit "8" in octal constant
   77 | Last login: Wed Apr 15 23:38:08 on console
      |                              ^~
a.cc:92:36: warning: multi-character character constant [-Wmultichar]
   92 | lol.cpp:36:8: error: no type named 'cout' in namespace 'std'
      |                                    ^~~~~~
a.cc:92:56: warning: multi-character character constant [-Wmultichar]
   92 | lol.cpp:36:8: error: no type named 'cout' in namespace 'std'
      |                                                        ^~~~~
a.cc:104:50: warning: multi-character character constant [-Wmultichar]
  104 | lol.cpp:9:3: error: use of undeclared identifier 'cin'; did you mean 'std::cin'?
      |                                                  ^~~~~
a.cc:104:70: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
  104 | lol.cpp:9:3: error: use of undeclared identifier 'cin'; did you mean 'std::cin'?
      |                                                                      ^~~~~~~~~~
a.cc:109:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
  109 |       'std::cin' declared here
      |       ^~~~~~~~~~
a.cc:112:40: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
  112 | lol.cpp:10:3: error: unknown type name 'string'; did you mean 'std::string'?
      |                                        ^~~~~~~~
a.cc:112:63: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
  112 | lol.cpp:10:3: error: unknown type name 'string'; did you mean 'std::string'?
      |                                                               ^~~~~~~~~~~~~
a.cc:117:7: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
  117 |       'std::string' declared here
      |       ^~~~~~~~~~~~~
a.cc:120:40: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
  120 | lol.cpp:11:3: error: unknown type name 'string'; did you mean 'std::string'?
      |                                        ^~~~~~~~
a.cc:120:63: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
  120 | lol.cpp:11:3: error: unknown type name 'string'; did you mean 'std::string'?
      |                                                               ^~~~~~~~~~~~~
a.cc:125:7: warning: multi-character literal with 11 characters exceeds 'int' size of 4 bytes
  125 |       'std::string' declared here
      |       ^~~~~~~~~~~~~
a.cc:128:51: warning: multi-character character constant [-Wmultichar]
  128 | lol.cpp:14:5: error: use of undeclared identifier 'cin'; did you mean
      |                                                   ^~~~~
a.cc:129:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
  129 |       'std::cin'?
      |       ^~~~~~~~~~
a.cc:134:7: warning: multi-character literal with 8 characters exceeds 'int' size of 4 bytes
  134 |       'std::cin' declared here
      |       ^~~~~~~~~~
a.cc:137:52: warning: multi-character literal with 6 characters exceeds 'int' size of 4 bytes
  137 | lol.cpp:19:12: error: use of undeclared identifier 'string'
      |                                                    ^~~~~~~~
a.cc:143:36: warning: multi-character character constant [-Wmultichar]
  143 | lol.cpp:36:8: error: no type named 'cout' in namespace 'std'
      |                                    ^~~~~~
a.cc:143:56: warning: multi-character character constant [-Wmultichar]
  143 | lol.cpp:36:8: error: no type named 'cout' in namespace 'std'
      |                                                        ^~~~~
a.cc:156:25: warning: multi-character character constant [-Wmultichar]
  156 | lol1.cpp:13:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:168:25: warning: multi-character character constant [-Wmultichar]
  168 | lol1.cpp:13:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:178:25: warning: multi-character character constant [-Wmultichar]
  178 | lol1.cpp:13:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:189:25: warning: multi-character character constant [-Wmultichar]
  189 | lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:206:25: warning: multi-character character constant [-Wmultichar]
  206 | lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:223:25: warning: multi-character character constant [-Wmultichar]
  223 | lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:235:25: warning: multi-character character constant [-Wmultichar]
  235 | lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:243:53: warning: multi-character literal with 13 characters exceeds 'int' size of 4 bytes
  243 | lol1.cpp:38:16: error: use of undeclared identifier 'unique_countk'; did you
      |                                                     ^~~~~~~~~~~~~~~
a.cc:244:12: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
  244 |       mean 'unique_count'?
      |            ^~~~~~~~~~~~~~
a.cc:248:23: warning: multi-character literal with 12 characters exceeds 'int' size of 4 bytes
  248 | lol1.cpp:21:29: note: 'unique_count' declared here
      |                       ^~~~~~~~~~~~~~
a.cc:254:25: warning: multi-character character constant [-Wmultichar]
  254 | lol1.cpp:23:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:268:25: warning: multi-character character constant [-Wmultichar]
  268 | lol1.cpp:24:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:291:25: warning: multi-character character constant [-Wmultichar]
  291 | lol1.cpp:24:7: warning: 'auto' type specifier is a C++11 extension
      |                         ^~~~~~
a.cc:1:1: error: 'Last' does not name a type
    1 | Last login: Mon Mar 16 20:11:35 on console
      | ^~~~
a.cc:33:58: error: 'did' does not name a type
   33 | lol.cpp:4:1: error: use of undeclared identifier 'cout'; did you mean
      |                                                          ^~~
a.cc:36:1: error: expected unqualified-id before '^' token
   36 | ^~~~
      | ^
a.cc:41:33: error: expected unqualified-id before '^' token
   41 |                                 ^
      |                                 ^
a.cc:42:59: error: 'did' does not name a type
   42 | lol.cpp:4:13: error: use of undeclared identifier 'endl'; did you mean
      |                                                           ^~~
a.cc:45:13: error: expected unqualified-id before '^' token
   45 |             ^~~~
      |             ^
a.cc:100:1: error: expected unqualified-id before '^' token
  100 | ^
      | ^
a.cc:104:57: error: 'did' does not name a type
  104 | lol.cpp:9:3: error: use of undeclared identifier 'cin'; did you mean 'std::cin'?
      |                                                         ^~~
a.cc:106:3: error: expected unqualified-id before '^' token
  106 |   ^~~
      |   ^
a.cc:111:33: error: expected unqualified-id before '^' token
  111 |                                 ^
      |                                 ^
a.cc:112:50: error: 'did' does not name a type
  112 | lol.cpp:10:3: error: unknown type name 'string'; did you mean 'std::string'?
      |                                                  ^~~
a.cc:114:3: error: expected unqualified-id before '^' token
  114 |   ^~~~~~
      |   ^
a.cc:119:65: error: expected unqualified-id before '^' token
  119 |                                                                 ^
      |                                                                 ^
a.cc:120:50: error: '