findddout / C

0 stars 0 forks source link

C3 #4

Open findddout opened 4 weeks ago

findddout commented 4 weeks ago

// ConsoleApplication4.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) { int i;

for (i = 0; i <= 10; i=i+2)
    printf("%d\n",i);

return 0;

}

findddout commented 4 weeks ago

// 201508271.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) { char x,y,z,w;

scanf("%c.%c.%c.%c",&x,&y,&z,&w);

if (x == '0')
    printf("0000");
else if (x == '1');
    printf("0001");
else if (x == '2');
    printf("0010");
else if (x == '3');
    printf("0011");
else if (x == '4');
    printf("0100");
else if (x == '5');
    printf("0101");
else if (x == '6');
    printf("0110");
else if (x == '7');
    printf("0111");
else if (x == '8');
    printf("1000");
else if (x == '9');
    printf("1001");
else if (x == 'A');
    printf("1010");
else if (x == 'B');
    printf("1011");
else if (x == 'C');
    printf("1100");
else if (x == 'D');
    printf("1101");
else if (x == 'E');
    printf("1110");
else if (x == 'F');
    printf("1111");

    scanf("%c.%c.%c.%c", &x, &y, &z, &w);

    if (x == '0')
        printf("0000");
    else if (x == '1');
    printf("0001");
    else if (x == '2');
    printf("0010");
    else if (x == '3');
    printf("0011");
    else if (x == '4');
    printf("0100");
    else if (x == '5');
    printf("0101");
    else if (x == '6');
    printf("0110");
    else if (x == '7');
    printf("0111");
    else if (x == '8');
    printf("1000");
    else if (x == '9');
    printf("1001");
    else if (x == 'A');
    printf("1010");
    else if (x == 'B');
    printf("1011");
    else if (x == 'C');
    printf("1100");
    else if (x == 'D');
    printf("1101");
    else if (x == 'E');
    printf("1110");
    else if (x == 'F');
    printf("1111");

//scanf("%f",&x);

//scanf("%c%c%c%c");

return 0;

}

findddout commented 4 weeks ago

// 201508311.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) { int x,y,i;

printf("please enter a number\n");
scanf("%d",&x);

y = 1;
for (i = 1; i <= x; i++)
{
    printf("%d\n", i);
    printf("--%d = %di * %dy\n", i*y,i,y);
    y = i*y;
}

//printf("this is the factorial of %d = %d");
return 0;

}

findddout commented 4 weeks ago

// Dec2Bin.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) {

int i, x;
int y;

//jyussinssuunonyuuryoiku
printf("please enter a number\n");
scanf("%d", &x);

//jyuusinnsuuhennkannnisinnsuu

for ( ; x > 1; )
{
    y = x % 2;
    x = x / 2;
    printf("%d",y);
}
//nissinnsuuunonyuryoku

printf("the number's binary is %d\n",x);

return 0;

}

findddout commented 4 weeks ago

// yuho1.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) { int x; int R; int i,j int y[20];

scanf("%d", &x);
for (i=0; x != 1 ; i++)
{
    y[i] = x % 2;//R = x % 2;
    x = x / 2;
    //printf("%d", R);
}
//printf("1\n");
y[i] = 1;
for (j = i; j >= 0; j--)

    printf("%d", y[j]);

}

return 0;

}

findddout commented 4 weeks ago

// yuho2.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) { int array[10], sum = 0; int i; for (i = 0; i < 10; i++) { printf("please enter a number (%d)",i); scanf("%d", &array[i]); } for (i = 0; i < 10; i++) sum = sum + array[i]; printf("Total number is ...%d",sum);

return 0;

}

findddout commented 4 weeks ago

// yuho3.cpp : Defines the entry point for the console application. //

include "stdafx.h"

int _tmain(int argc, _TCHAR* argv[]) { int num1; int num2; int num3; int num4;

printf("please enter a number\n");
scanf("%d", &x);

num1 = x / 1000;
num2 = x % 1000 / 100;
num3 = x % 1000 % 100 / 10;
num4 = x % 1000 % 100 % 10 / 1;

x = num4, num3, num2, num1;
printf("%d", x);

return 0;

}

findddout commented 4 weeks ago

include

int main(void) { int a,i; /for(1 = 0; i < 10; i++){ printf("Enter a number: "); scanf("%d",&a); printf("%d\n",aa); } */

    printf("Enter a number: ");
    scanf("%d",&a);
    while (a >= 0)// for (; a>=0 ;)
    {
        printf("%d\n",a*a);
        printf("Enter a number: ");
        scanf("%d",&a);
    }
    do {
        printf("Enter a number: ");
        scanf("%d",&a);
    } while (a >= 0);

return 0;

}

findddout commented 4 weeks ago

include

int main(void) { int a,i; //for(1 = 0; i < 10; i++){ printf("Enter a number: "); scanf("%d",&a); while (a != -1) { printf("%d\n",a*a); printf("Enter a number: "); scanf("%d",&a); }

return 0;

}