Created
November 27, 2015 19:16
-
-
Save kemalkanok/7f4607c8c69fa8b7c82f to your computer and use it in GitHub Desktop.
c testleri
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "stdio.h" | |
#include "time.h" | |
#include "stdlib.h" | |
#include "math.h" | |
#include "string.h" | |
//2002 | |
//soru 5 | |
// int main(int argc, char const *argv[]) | |
// { | |
// int w = 0 , h=0; | |
// printf("width:" ); | |
// scanf("%d",&w); | |
// printf("height:"); | |
// scanf("%d",&h); | |
// for (int i = 0; i < h; i++) | |
// { | |
// for (int j = 0; j < i; j++) | |
// { | |
// printf(" "); | |
// } | |
// for (int j = 0; j < w; j++) | |
// { | |
// printf("*"); | |
// } | |
// printf("\n"); | |
// } | |
// return 0; | |
// } | |
//soru 6 | |
// int main(int argc, char const *argv[]) | |
// { | |
// int ogrNo[2] = {1,2}; | |
// int notlar[2] = {5,6}; | |
// for (int i = 0; i < 2; i++) | |
// { | |
// printf("%d,%d\n", ogrNo[i] , notlar[i] ); | |
// } | |
// for (int i = 0; i < 2; i++) | |
// { | |
// notlar[i] = notlar[i] + 10; | |
// printf("%d,%d\n", ogrNo[i] , notlar[i] ); | |
// } | |
// return 0; | |
// } | |
//soru 7 | |
// int main(int argc, char const *argv[]) | |
// { | |
// //for | |
// int total = 0; | |
// for (int i = 1; i <= 100; i = i + 2 ) | |
// { | |
// total += i; | |
// } | |
// printf("%d\n",total ); | |
// //while | |
// total = 0; | |
// int i = 1; | |
// while(i <= 100) | |
// { | |
// total += i; | |
// i+=2; | |
// } | |
// printf("%d\n",total ); | |
// //do-while | |
// total = 0; | |
// i = 1; | |
// do | |
// { | |
// total += i; | |
// i+=2; | |
// } while (i <= 100); | |
// printf("%d\n",total ); | |
// return 0; | |
// } | |
//2003 | |
//1 | |
// int main(int argc, char const *argv[]) | |
// { | |
// int dizi[10]; | |
// for (int i = 0; i < 10; i++) | |
// { | |
// printf("(%d).deger:\n", i+1); | |
// scanf("%d",&dizi[i]); | |
// } | |
// return 0; | |
// } | |
//4 | |
// void binary(int sayi) | |
// { | |
// int sayis[50] = {0}; | |
// int i = 0; | |
// while(sayi > 2) | |
// { | |
// sayis[i] = sayi % 2; | |
// sayi = sayi / 2; | |
// i++; | |
// } | |
// sayis[i] = 1; | |
// for (int j = i; j >= 0; j--) | |
// { | |
// printf("%d", sayis[j]); | |
// } | |
// } | |
// int main(int argc, char const *argv[]) | |
// { | |
// binary(17); | |
// return 0; | |
// } | |
//soru 5 | |
// int main(int argc, char const *argv[]) | |
// { | |
// int w = 0 , h=0; | |
// printf("width:" ); | |
// scanf("%d",&w); | |
// printf("height:"); | |
// scanf("%d",&h); | |
// for (int i = 0; i < h; i++) | |
// { | |
// for (int j = 0; j < i; j++) | |
// { | |
// printf(" "); | |
// } | |
// for (int j = 0; j < w-i; j++) | |
// { | |
// printf("*"); | |
// } | |
// printf("\n"); | |
// } | |
// return 0; | |
// } | |
//Soru | |
/*int main(int argc, char const *argv[]) | |
{ | |
int dizi[10] = {0}; | |
int status = 0; | |
for (int i = 0; i < 50; ++i) | |
{ | |
status = 0; | |
for (int j = 0; j < 10; j++) | |
{ | |
if(rand() %2 == 1) | |
{ | |
status++; | |
} | |
} | |
printf("%d\n", status); | |
dizi[i] = status; | |
} | |
return 0; | |
}*/ | |
//2004 | |
//2 | |
// int main(int argc, char const *argv[]) | |
// { | |
// float i = 0; | |
// float formula = 0; | |
// for (i = 0; i < 10; i += 0.5) | |
// { | |
// formula = 2 *i*i*i + 6 * i * i + 3 * i - 1; | |
// printf("%.1f\n",formula); | |
// } | |
// return 0; | |
// } | |
//2005 | |
//3 | |
// int main(int argc, char const *argv[]) | |
// { | |
// int n = 10; | |
// float result = 0; | |
// for (int i = 1; i < n; i++) | |
// { | |
// int fak = 1; | |
// for (int j = 1; j < i; j++) | |
// { | |
// fak*=j; | |
// } | |
// result += sqrt(i + ((n-1) /fak) ); | |
// } | |
// printf("%f\n", result); | |
// return 0; | |
// } | |
//2006 | |
//extra 2 | |
// int main(int argc, char const *argv[]) | |
// { | |
// char yazi[BUFSIZ]; | |
// scanf("%s",&yazi[0]); | |
// for (int i = 0; i < strlen(yazi); ++i) | |
// { | |
// yazi[i] += 3; | |
// } | |
// printf("%s\n", yazi ); | |
// return 0; | |
// } | |
//extra | |
// int prime(int N) | |
// { | |
// for (int i = 2; i < N-1; ++i) | |
// { | |
// if(N % i == 0) | |
// { | |
// return 0; | |
// } | |
// } | |
// return N; | |
// } | |
// int main(int argc, char const *argv[]) | |
// { | |
// if(!prime(3)) | |
// { | |
// printf("test\n"); | |
// } | |
// return 0; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment