int main(void){ int mass_a1[3]; int mass_a2[3]; int massmeelde[3]={0, 0, 0}; int massvastus[3]; int a1;//esimene sisestatud arv int a2;//teine sisestatud arv printf("Sisesta esimene arv:"); scanf("%d",&a1); printf("Sisesta teine arv:"); scanf("%d",&a2); massvastus[1] = a1%10; mass_a1[0]= massvastus[1]; a1=a1/10; mass_a1[1]= a1%10; a1=a1/10; massvastus[1] = a2%10; mass_a2[0]= massvastus[1]; a2=a2/10; mass_a2[1]= a2%10; a2=a2/10; massvastus[1]= mass_a1[0]+mass_a2[0]; if (massvastus[1]>9){ massmeelde[1]=1; massvastus[1]=massvastus[1]-10; } massvastus[2]= mass_a1[1]+mass_a2[1]+massmeelde[1]; if (massvastus[2]>9){ massmeelde[2]=1; } printf("%d%d\n",massmeelde[2],massmeelde[1]); printf(" %d%d\n",mass_a1[1],mass_a1[0]); printf("+\n"); printf(" %d%d\n",mass_a2[1],mass_a2[0]); printf("-----\n"); if (massvastus[2]>10){ printf("%d%d\n",massvastus[2],massvastus[1]); } if (massvastus[2]<10){ printf(" %d%d\n",massvastus[2],massvastus[1]); } system("PAUSE"); return 0; }