From 9d7fe660fae020bfe5650cd12890c19680f2ef55 Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 18 May 2017 17:25:46 +0200 Subject: deleted some file --- cpp/numeri.cc | 50 -------------------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 cpp/numeri.cc (limited to 'cpp/numeri.cc') diff --git a/cpp/numeri.cc b/cpp/numeri.cc deleted file mode 100644 index ec2d2d4..0000000 --- a/cpp/numeri.cc +++ /dev/null @@ -1,50 +0,0 @@ -#include -#include - -using namespace std; - -int main(void) -{ - fstream file; - file.open("dati.dat"); - - typedef unsigned short int size_t; - - size_t a, b, c, seq = 0, tot = 0, num; - char stringa[] = "12312312312"; - char l; - while(true) - { - cout << "3 numeri: "; - cin >> a >> b >> c; - if(a >= 0 && a <= 9 && b >= 0 && b <= 9 && c >= 0 && c <= 9){ - if(a != b && b != c && a != c) break; - } - } - - file << a << endl; - file << b << endl; - file << c << endl; - file << stringa << endl; - file.seekg(5, file.beg); - - while(!file.eof()) - { - file.get(l); - num = l - '0'; - if(seq == 0) { - if(num == a) seq++; - } else if(seq == 1) { - if(num == b) seq++; - } else if(seq == 2) { - if(num == c) seq++; - } - - if(seq == 3) { tot++; seq = 0; } - } - - cout << "\n" << tot; - file.close(); - - return 0; -} -- cgit v1.2.3-18-g5258