自渡 发表于 2020-10-25 17:36:00

c语言第一课

#include <stdio.h>
#include <stdlib.h>
int main()
{
        int iA=1234;
        double dB=123.456;
        short sC=123;
        long lD=300000000;
        printf("iA=%8d*\n",iA);
    printf("iA=%8d*\n",iA);
    printf("iA=%-8d*\n",iA);
    printf("iA=%+d*\n",iA);
    printf("iA=%08d*\n",iA);
    printf("iA=%#x*\n",iA);
    printf("dB=%.2f*\n",dB);
    printf("dB=%.4f*\n",dB);
    printf("dB=%10.2f*\n",dB);
    printf("dB=%-10.4f*\n",dB);
    printf("sC=%hd*\n",sC);
    printf("lD=%ld*\n",lD);
        return 0;
}

Guido 发表于 2020-10-26 20:31:52

可以可以,坚持学习!
页: [1]
查看完整版本: c语言第一课