Beruflich Dokumente
Kultur Dokumente
Pract 7
Pract 7
#include<stdio.h>
#include<math.h>
#define YYSTYPE double
YYSTYPE last_value=0;
int yyerror(const char *s);
extern int yylex(void);
%}
%token NUMBER
%token LAST
%left '+' '-' '*' '/' '^'
%%list:
| list '\n'
| list expr '\n' {printf("%.10g\n",last_value=$2);
}
;
;
%%
#include<stdlib.h>
#include<string.h>
#include<unistd.h>
int lineno;
char *fname = "-stdin-";
int yyerror(const char *s)
{
fprintf(stderr,"%s(%d):%s\n",fname,lineno,s);
return 0;
}
main()
{
yyparse();
return 0;
}
////////////****************************////////////////
%{
#include "stdio.h"
#include "unistd.h"
#include "stdlib.h"
#include "math.h"
#define YYSTYPE double
#include "y.tab.h"
extern int lineno; /* current line number */
extern YYSTYPE yylval; /* value of numeric token */
%}
digit [0-9]
space [ \t]
%%
#include<bits/stdc++.h>
using namespace std;
int main()
{
long int x;
cin>>x;
long int out=1<<x;
cout<<out;