You are requested to help in writing a program to perform addition of two large number up to 50-digits. In C there is no builtin datatype for large number, but we can use characters and array to solve the problem.
Input: The input will contain two positive integers are separated by a blank, the two positive integers do not exceed 50-digits.
Output: Sum.
寫一個程式輸入兩個大數(最大50個位數),計算其總合。C語言不提供大數資料型態,但我們可以用字元和陣列來解決這個問題。
Example input:
999999999999999999999999999999 999999999999999999999999999999
Example output:
1999999999999999999999999999998
Hidden content!#include<stdio.h>#include<string.h>int main(){ int i,j,k,n,t=0,c[53]={};*** * * * * ** * * * ** ** * ** a[51],b[51];* * *** * * ***** * * * * **** ** ** %s",a,b);