1. 程式人生 > 實用技巧 >Flink基礎(三十):FLINK SQL(六)ALTER 語句

Flink基礎(三十):FLINK SQL(六)ALTER 語句

實驗一

# include<stdio.h>
# include<math.h>
void solve(double a,double b, double c)
{
    double x1,x2;
    double delta,real,imag;
    
    if(a==0)
    printf("not quadratic equation.\n");
    else{
    delta =b*b-4*a*c;
    
    if(delta>=0){
    x1=(-b+sqrt(delta))/(2*a);
    x2=(-b-sqrt(delta))/(2
*a); printf("x1=%f,x2=%f\n",x1,x2); } else{ real=-b/(2*a); imag = sqrt(-delta)/(2*a); printf("x1=%f+%fi,x2=%f-%fi\n",real,imag,real,imag); } } } int main(){ double a,b,c; printf("Enter a,b,c: "); while(scanf("%lf%lf%lf",&a,&b,&c)!=EOF){ solve(a,b,c); printf(
"Enter a,b,c:"); } return 0; }

實驗二

# include<stdio.h>
long long fac(int n){
    static long long p=1;
    p=p*n;
    return p;
}
int main(){
    int i,n;
    
    printf("enter n:");
    scanf("%d",&n);
    
    for(i=1;i<=n;++i)
    printf("%d!=%11d\n",i,fac(i));
    return
0; }

新增後