[ create a new paste ] login | about

Link: http://codepad.org/GhVBPtPE    [ raw code | output | fork ]

C++, pasted on Mar 18:
// --- StdAfx.h ---

#include <stdio.h>
#include <tchar.h>

#include <locale>
#include <string>
#include <iostream>
#include <fstream>

#define НАЧАЛО \
int _tmain(int argc, _TCHAR* argv[]) {\
  std::locale::global(std::locale(""));\
  std::streambuf *cons_buf = std::cout.rdbuf();\
  class out2file {\
    std::ofstream of_;\
  public:\
    out2file& operator=(const char* f) {\
      of_.open(f);\
      std::cout.rdbuf(of_.rdbuf());\
      return *this;\
    }\
  } o2f;
#define КОНЕЦ  return 0; }
#define ПРОГРАММЫ

#define Выведи
#define текст
#define на
#define экран std::cout.rdbuf(cons_buf);
#define в
#define файл o2f =

#define начало ;std::cout <<
#define конец ;
#define текста


// --- main.cpp ---
// Компилировать:
// MSVC  c ключем /FI "StdAfx.h"
// GCC   c ключем -include "StdAfx.h"
// ----------------

НАЧАЛО ПРОГРАММЫ

Выведи текст на экран

начало текста
"Я помню чудное мгновенье: \n\
Передо мной явилась ты, \n\
Как мимолетное виденье, \n\
Как гений чистой красоты."
конец текста

Выведи текст в файл "Стих.txt"

начало текста
"В томленьях грусти безнадежной\n\
В тревогах шумной суеты,\n\
Звучал мне долго голос нежный\n\
И снились милые черты."
конец текста

КОНЕЦ ПРОГРАММЫ


Output:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Line 18: error: tchar.h: No such file or directory
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 8: error: macro names must be identifiers
Line 45: error: stray '\320' in program
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: