Using the Library of functions:
#include <stdio.h> #include <string.h> #include <stdlib.h>
Source Code (addition):
#include <stdio.h> #include <string.h> #include <stdlib.h> int main (void) { char s1[100],s2[100],s3[100],s4[100],s5[100],s6[100] //because it is a sub-total program, please ignore the extra long N=-1,n1=0,n2=0,n3=0,x1,x2,x3,x4,x5,x6,y3,y4 scanf ("%s ", S5) //input string s5 scanf ("%s ", S6) //input string s6
x5=Atol (S5); //Use the Stdlib function library to atol* (convert string to grow integer number)
x6=Atol (S6); //Convert string S5, S6 to Long X5 X6 If (x5<0&&x6>=0) //Set if X5, X6 a positive and negative situation { n3=x5-x6; //Set-case relationship } else //negative and positive conditions { n3=x6-x5; //Relationship type } if (x5>=0&&x6>=0| | X5<0&&X6<0) //Set X5, X6 symbol under the same conditions { n3=x5+x6; X5, X6 and N3 when//x5 and X6 symbols are the same } printf ("%d", N3); return 0; }
Author Evaluation:
Because of the limitations of the ATOL, so this program is "quasi", temporarily can only be in the "long" type of the high accuracy of the data plus minus, not a good program, but because he is a part of an integrated program, so more practical. Please sir wait for a moment, the full version will appear in your eyes!
Please comment on the error, new report, tender, wrong please point out.
High-precision Addition