Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- FILE *s1, *s2;
- int a, b, c;
- s1 = fopen("bit.txt", "r");
- s2 = fopen("bit2.txt", "w");
- if (!s1)
- printf("Error open bit.txt\n");
- else
- {
- while (!feof(s1))
- {
- fscanf(s1, "%d %d %d\n", &a, &b, &c);
- if ((a + b > c) && (a + c > b) && (b + c > a)) {
- fprintf(s2, "%d %d %d\n", a, b, c);
- }
- }
- }
- fclose(s1);
- fclose(s2);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement