UVA Solution 465 - Overflow - Solution in C,C++
UVA Online Judge Solution 465 - Overflow | Volume 4UVA Problem Link - 465 - Overflow
Problem Name: 465 - Overflow Solution
Problem Number : UVA - 465 - Overflow Code
Online Judge : UVA Online Judge Solution
Volume: 4
Solution Language : C plus plus
UVA Solution 465 - Overflow Code in C/CPP:
#include<stdio.h> int main() { double a, b; int INF = 2147483647; char op, s[2000]; while(gets(s)) { printf("%s\n", s); sscanf(s, "%lf %c %lf", &a, &op, &b); if(a > INF) puts("first number too big"); if(b > INF) puts("second number too big"); if(op == '+' && a+b > INF) puts("result too big"); if(op == '*' && a*b > INF) puts("result too big"); } return 0; }
Tags: UVA Online Judge Solution, UVA OJ Solution list, UVA Problems Solution, UVA solver, UVA all problem solution list, UVA 465 code in C, UVA 465 - Overflow code in C++, UVA 465 - Overflow solution in C, UVA 465 solution
No comments:
Post a Comment