{"id":767,"date":"2012-03-29T13:21:38","date_gmt":"2012-03-29T12:21:38","guid":{"rendered":"http:\/\/csipet.web.elte.hu\/?p=188"},"modified":"2012-03-29T13:21:38","modified_gmt":"2012-03-29T12:21:38","slug":"7-ora-2","status":"publish","type":"post","link":"https:\/\/peter.csonka.hu\/hu\/blog\/2012\/03\/7-ora-2\/","title":{"rendered":"7. \u00f3ra"},"content":{"rendered":"<p><a href=\"https:\/\/docs.google.com\/document\/d\/1R_rYGMRvzEaBQeMp0OtLd6v3L3-ajliMKf4YOBGnMcE\/edit\">https:\/\/docs.google.com\/document\/d\/1R_rYGMRvzEaBQeMp0OtLd6v3L3-ajliMKf4YOBGnMcE\/edit<\/a><\/p>\n<pre lang=\"c\" line=\"1\">\n#include <stdio.h>\n#include <stdlib.h>\n#include <math.h>\n#include <time.h>\n\nvoid kiir(int n, int *a);\n\nint main(){\n\tint * input;\n\/\/\tint i;\n\tint i = 1;\n\tint ertek;\n\tint j;\n\tsrand(time(NULL));\n\tint x = sizeof(int);\n\tint y = sizeof(int);\n\tinput = (int *) malloc(x);\n\tfor(j = 0; j < i; j++){\n\t\tprintf(\"Kerem az erteket: \");\n\t\tscanf(\" %d\", &#038;ertek);\n\t\tif(ertek>0){\n\t\t\tinput = realloc(input, y);\n\/\/\t\t\tinput[j] = rand() % 100;\n\t\t\tinput[j] = ertek;\n\t\t\ty = y + x;\n\t\t\ti++;\n\t\t}\n\t}\n\tkiir(i, input);\n\treturn 0;\n}\n\nvoid kiir(int n, int *a){\n\tint i;\n\tfor(i = 0; i < n; i++){\n\t\tprintf(\"Az %d. elem: %dn\", i , a[i]);\n\t}\n}\n<\/pre>\n<pre lang=\"c\" line=\"1\">\n#include <stdio.h>\n#include <stdlib.h>\n#include <errno.h> \/\/ hibakezel\uad28ez\n#include <dirent.h>\n#include <sys\/types.h>\n#include <string.h>\n#include <sys\/stat.h>\n\nvoid konyvtar(char form[], char di[]){\n\tDIR * D;\n\tstruct dirent * direntp;\n\tstruct stat my_status;\n\tchar new_form[80];\n\tchar new_form_s[80];\n\tchar fname[80];\n\tstrcpy(new_form, form);\n\tstrcat(new_form, \"t \");\n\tstrcpy(new_form_s, form);\n\tstrcat(new_form_s, \"%sn\");\n\t\n\tchdir(di);\n\tD = opendir(\".\");\n\tif(!errno){\n\t\t\/\/ k\u00f6nyvt\u00e1r nyitva, olvassuk\n\t\twhile((direntp=readdir(D))!=NULL){\n\t\t\tstrcpy(fname, direntp -> d_name);\n\t\t\tprintf(new_form_s, fname);\n\t\t\tif((strcmp(fname, \".\")!=0) && (strcmp(fname, \"..\")!=0)){\n\t\t\t\tstat(fname, &my_status);\n\t\t\t\tif(S_ISDIR(my_status.st_mode)){\n\t\t\t\t\tstrcat(new_form, \"t\");\n\t\t\t\t\tkonyvtar(new_form, fname);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tclosedir(D);\n}\n\nint main(){\n\tchar D[80] = \".\";\n\tprintf(\"Az aktualis konyvtar tartalma: n\");\n\tkonyvtar(\" \", D);\n\treturn 0;\n}\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/docs.google.com\/document\/d\/1R_rYGMRvzEaBQeMp0OtLd6v3L3-ajliMKf4YOBGnMcE\/edit #include #include #include #include void kiir(int n, int *a); int main(){ int * input; \/\/ int i; int i = 1; int ertek; int j; srand(time(NULL)); int x = sizeof(int); int y = sizeof(int); input = (int *) malloc(x); for(j = 0; j < i; j++){ printf(\"Kerem az erteket: \"); scanf(\" %d\", &#038;ertek); if(ertek>0){ input = realloc(input, y); \/\/ input[j] = rand() % 100; input[j] = ertek; y = y + x; i++; } } kiir(i, input); return 0; } void kiir(int n, int *a){ int i; for(i = 0; i < n; i++){ printf(\"Az %d. elem: %dn\", i...\n<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-767","post","type-post","status-publish","format-standard","hentry","category-szamitogepes-alapismeretek-2"],"_links":{"self":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/posts\/767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/comments?post=767"}],"version-history":[{"count":0,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/posts\/767\/revisions"}],"wp:attachment":[{"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/media?parent=767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/categories?post=767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/peter.csonka.hu\/hu\/wp-json\/wp\/v2\/tags?post=767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}