Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- /////////////////////////////////////////////////////////
- class TT //
- {
- public:
- int n;
- static int nCounter;
- TT()
- {
- nCounter ++;
- printf("Hello ! nCounter = %d\n", nCounter);
- }
- ~TT()
- {
- printf("Goodbye .\n");
- }
- } ;
- int TT::nCounter;
- //////////////////////////////////////////////////////
- int main() //
- {
- TT a[3];
- printf("nCounter = %d, n = %d \n", a[0].nCounter, a[0].n);
- printf("nCounter = %d, n = %d \n", a[1].nCounter, a[1].n);
- printf("nCounter = %d, n = %d \n", a[2].nCounter, a[2].n);
- }
- /*
- #include <iostream>
- using namespace std;
- int a = 0,
- b = 0;
- ////////////////////////////////////////
- int foo()
- {
- int nRes = 0;
- if(a <= b) return b - a;
- if(a%b != 0) return b * (a/b + 1) - a;
- return nRes;
- }
- ////////////////////////////////////////////////////// int arr[100];
- int main() // arr[i] = a;
- { // cout << endl;
- int n = 0;
- cin >> n;
- for(int i = 0; i < n; i++)
- {
- cin >> a >> b;
- cout << foo() << endl;
- }
- }
- */
- /*
- for (int i = 0; i < n*2; i++)
- {
- if (arr[i] % arr[i + 1] == 0)
- {
- cout << 0 << endl;
- }
- else
- {
- while (arr[i] % arr[i + 1] != 0)
- {
- c++;
- arr[i] = arr[i] + 1;
- }
- if (i % 2 == 0)
- {
- cout << c << endl;
- }
- c = 0;
- }
- }
- */
- /*
- #include <cstdio>
- int n;
- char sz[123];
- /////////////////////////////////////////// TextFile
- int main()
- {
- FILE *fp;
- fp = fopen("setting.txt", "r");
- if(fp != 0)
- {
- printf("Ok, file is open.\n");
- fscanf(fp, "%d%s", &n, sz);
- printf("n = %d, sz = %s\n", n, sz);
- }
- else printf("Error!");
- fclose(fp);
- }
- */
- /*
- #include <cstdio>
- /////////////////////////////////////////// TextFile
- int main()
- {
- FILE *fp;
- fp = fopen("setting.txt", "w");
- if(fp != 0) fprintf(fp, "F\n");
- else printf("Error!");
- fclose(fp);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement