黑马程序员-20141211-总结2

------Java培训、Android培训、iOS培训、.Net培训、期待与您交流! -------


 
  

/*
 计算0-100以内所有3的倍数的个数

*/

#include 

int main()
{
    int count = 0;
    int number = 0;
    
    while (number<100)
    {
        number++;
        if (number%3==0)
        {
            count++;
        }
    }

    printf("0-100以内所有3的倍数的个数是%d\n",count);
    
    return 0;
}
#include 

int main()
{
    /*int number = 0;
    for (; number <50; ) {
        printf("做第%d次俯卧撑\n",number);
        number++;
    }*/
    
    
    
    /*for (int number = 0; number <50; number++)
    {
        printf("做第%d次俯卧撑\n", number);
    }*/
    
    
    /*int count = 0;
    for (;count<50;)
    {
        printf("做第%d次俯卧撑\n",count);
        count++;
    
    }*/
    
    
   
   /* for ( int count = 0;count<50;)
    {
        printf("做第%d次俯卧撑\n",count);
        count++;
        
    }
*/
    
   /* for ( int count = 0;count<50;count++)
    {
        
        printf("做第%d次俯卧撑\n",count);
        
    }
*/
    int count = 0;
    while (count <50)
    {
        printf ("做第%d次俯卧撑\n",count);
        count++;
    
    }


    return 0;
}

//1>	提示用户输入一个正整数n,如果n5,就输出下列图形,其他n值以此类推


#include 

int main()
{
    //提示输入正整数
    int n =0;
    while (n <=0)
    {
        printf("请输入一个正整数:\n");
        scanf("%d",&n );
    }
    
    
    for (int i =0; i


你可能感兴趣的:(黑马程序员-20141211-总结2)