|
|
|
|
для: SacReD_89
(24.04.2010 в 12:55)
|
| // прога такая
#include "stdafx.h"
#include <stdio.h>
#include <conio.h>
#include <iostream>
using namespace std;
void main ()
{
int a[50], b[50], c[50], i, q, A, B,j,w;
for (i=0; i<=50; i++)
{
a[i]=b[i]=c[i]=0;
//c[51]=0;
}
{
cout << "Input first number: ";
for (i=0; i<50; i++)
{
A=getche();
a[i]=(int)A;
// cout <<endl<< a[i];
}
printf("\n");
cout << "Input second number: ";
for (j=0; j<50; j++)
{
B=getche();
b[j]=(int)B;
// cout <<endl<< b[j];
}
printf("\n");
for(q=50; q>=0; q--)
{
c[q+1]+= a[q]+b[q];
if (c[q+1]>9)
c[q]+=1;
}
for (w=0; w<=50; w++)
{
cout << c[w];
}
}
getch();
} | |
|
|