Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int n = 8;
- int foo(int *);
- ////////////////////////////////////////////////////
- int main()
- {
- int n = 123;
- int *p = (int*)malloc(sizeof(int)*10);
- for(int i = 0; i < 10; i++)
- {
- p[i] = 100 + i;
- }
- for(int i = 0; i < 10; i++)
- {
- printf("%d\n", p[i]);
- }
- }
- /*
- #include <stdio.h>
- int n = 8;
- __int32 n2 = 71;
- __int16 n3 = 211;
- unsigned __int8 n4 = 211;
- ////////////////////////////////////////////////////
- int main()
- {
- printf("size of n = %d bytes.\n", sizeof(n ));
- printf("size of n2 = %d bytes.\n", sizeof(n2));
- printf("size of n3 = %d bytes.\n", sizeof(n3));
- printf("size of n4 = %d bytes.\n", sizeof(n4));
- for(int i = 240; i < 260; i++)
- {
- n4 = i;
- printf("n4 = %d\n", n4);
- }
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 8;
- int foo(int *);
- ////////////////////////////////////////////////////
- int main()
- {
- int n = 123;
- int *p = (int*)malloc(4);
- }
- ///////////////////////////////////////////////////
- int foo(int *p)
- {
- }
- */
- /*
- #include <stdio.h>
- float fn = 17;
- float f = 2.99;
- ////////////////////////////////////////////////////
- int main()
- {
- fn += f;
- printf("fn = %.2f\n", fn);
- }
- */
- /*
- #include <stdio.h>
- int n = 17;
- ////////////////////////////////////////////////////
- int main()
- {
- float f = (float)n/2;
- printf("n2 = %.2f\n", f);
- }
- */
- /*
- #include <stdio.h>
- int n = 17;
- ////////////////////////////////////////////////////
- int main()
- {
- int n2 = n/2;
- printf("n2 = %d\n", n2);
- }
- */
- /*
- #include <stdio.h>
- #include <stdlib.h>
- int n = 8;
- int foo(int *psdgjhskjdgh);
- ////////////////////////////////////////////////////
- int main()
- {
- int n = 123;
- int *p = (int*)malloc(4);
- }
- int foo(int *p)
- {
- }
- */
- /*
- #include <stdio.h>
- int nNumb = 2; // kolichestvo knig
- ////////////////////////////////////////////////////
- int reset(int *p1, int *p2) //
- {
- if( *p1 > 6) {
- *p1 = 0;
- *p2 = 1000;
- }
- }
- ////////////////////////////////////////////////////
- int main()
- {
- int t = 0,
- n = 1000,
- counter = 0;
- for(int i = 0; i < nNumb; i++)
- {
- t = t+n;
- n = n-55;
- counter = counter + 1;
- reset( &counter, &n);
- }
- printf("Total cost %d = %d\n", nNumb, t);
- }
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement