Cod sursa(job #1703560)

Utilizator tudormaximTudor Maxim tudormaxim Data 17 mai 2016 09:47:42
Problema A+B Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 2.23 kb
/*#include <iostream>
#include <fstream>
#include <queue>
#include <vector>
using namespace std;

ifstream fin ("1234.in");
ofstream fout ("1234.out");

const int nmax = 155;
const int oo = 1<<28;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
char image[nmax][nmax];
bool viz[nmax][nmax];
int n, m;
struct point {
    int x, y;
    inline point& operator () (int a, int b) {
        x=a, y=b;
    }
} left_up, left_down, right_up, right_down;

void boarding() {
    int i;
    for(i=0; i<=n+1; i++) {
        image[i][0]=image[i][m+1]='2';
    }
    for(i=0; i<=m+1; i++) {
        image[0][i]=image[n+1][i]='2';
    }
}

void Fill(int a, int b) {
    queue <point> q;
    point p;
    p(a, b);
    int nx, ny, xx, yy, i;
    q.push(p);
    viz[a][b]=true;
    while(!q.empty()) {
        nx=q.front().x;
        ny=q.front().y;
        q.pop();
        left_up(min(left_up.x, nx), min(left_up.y, ny));
        left_down(max(left_down.x, nx), min(left_down.y, ny));
        right_up(min(right_up.x, nx), max(right_up.y, ny));
        right_down(max(right_down.x, nx), max(right_down.y, ny));
        for(i=0; i<8; i++) {
            xx=nx+dx[i];
            yy=ny+dy[i];
            if(viz[xx][yy]==false && image[xx][yy]=='0') {
                viz[xx][yy]=true;
                p(xx, yy);
                q.push(p);
            }
        }
    }
}

void get_char() {

}

int main() {
    ios_base::sync_with_stdio(false);
    int i, j;
    fin >> n >> m;
    for(i=1; i<=n; i++) {
        fin >> (image[i]+1);
    }
    boarding();
    for(i=1; i<=n; i++) {
        for(j=1; j<=m; j++) {
            if(viz[i][j]==false  && image[i][j]=='0') {
                left_up(oo, oo);
                left_down(-oo, oo);
                right_up(oo, -oo);
                right_down(-oo, -oo);
                Fill(i, j);
                get_char();
            }
        }
    }
    fout << counter;
    return 0;
}*/

#include <fstream>

using namespace std;

int main()
{
    ifstream in("adunare.in");
    ofstream out("adunare.out");
    int a,b,s;
    in>>a>>b;
    s=a+b;
    out<<s;
    in.close();
    out.close();
    return 0;
}