Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
717 B
0
Indexable
Never
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){char a[14], b[14], c[14], d[14];char* r;scanf("%s %s %s %s", a, b, c, d);while (strtoll(a, &r, 10) < -1000000 || strtoll(a, &r, 10) > 1000000 || strtoll(c, &r, 10) < -1000000 || strtoll(c, &r, 10) > 1000000 || strtoll(b, &r, 10) < 0 || strtoll(b, &r, 10) > 1000000 || strtoll(d, &r, 10) < 0 || strtoll(d, &r, 10) > 1000000) { printf("Neispravan unos!\n");scanf("%s %s %s %s", a, b, c, d);}strcat(a, b);strcat(c, d);printf("%s+%s=%lld\n%s-%s=%lld\n%s*%s=%lld", a, c, strtoll(a, &r, 10) + strtoll(c, &r, 10), a, c, strtoll(a, &r, 10) - strtoll(c, &r, 10), a, c, strtoll(a, &r, 10) * strtoll(c, &r, 10));return 0;}
Leave a Comment