當前位置:首頁 » 編程軟體 » 編程提示語

編程提示語

發布時間: 2022-05-22 16:48:23

① VFP控制項提示語

首先 表單屬性的 SHOWTIPS 要設為 .T.

然後 需要提示 的控制項 的 tooltiptext 屬性中填寫要顯示的字串

c語言編程,有提示的

要把一個年月日表示成一個數,一般是10000x年+100x月+日

#include <stdio.h>


int Rc(int s, int y) {

int c = 0;

for (int i = s; i < y; i++)

if ((i % 4 == 0 && i % 100 != 0) || i % 400 == 0)

c++;

return c;

}


int TandN(int n) {

int two = 0, nine = 0;

while (n) {

if (n % 10 == 2) two++;

if (n % 10 == 9) nine++;

if (two && nine) return 1;

n /= 10;

}

return 0;

}


int main() {

int q, y, m, d, c;

int cntDay[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};


scanf("%d", &q);

while (q--) {

scanf("%d %d %d", &y, &m, &d);

c = 0;

for (int i = 1; i < y; i++)

for (int j = 1; j <= 12; j++)

for (int k = 1; k <= cntDay[j - 1]; k++)

c += TandN(10000 * i + 100 * j + k);


for (int j = 1; j < m ; j++)

for (int k = 1; k <= cntDay[j - 1]; k++)

c += TandN(10000 * y + 100 * j + k);


for (int k = 1; k <= d; k++)

c += TandN(10000 * y + 100 * m + k);


if (Rc(y, y + 1)) c += m > 2 || (m == 2 && d == 29);

c += Rc(1, y);

printf("%d ", c);

}

return 0;

}

③ 編程標語宣傳語

會電腦,是EQ;會編程,是IQ!

④ C語言編程中出現這個提示是什麼意思

贊下用手機編程的勤奮孩子
這里的問題是,printf應該只有一個參數,而你寫了多個,所以。。。
應該這么寫
printf("%d,%d,%d",x,y,z);

還有,樓上說的也是,你的?:運算符用的不對

⑤ C語言編程,拜託會的可以給點提示,或寫下給我看看

#include<stdio.h>
#include<stdlib.h>
typedef struct { //定義操作數棧;
float *base;
float *top;
}operand;

typedef struct { //定義操作符棧;
char *base;
char *top;
} operater;

void InitStack1 (operand &S) //初始化操作數棧的函數;
{
S.base=(float *)malloc (100*sizeof(float));
S.top=S.base;
}

void InitStack2 (operater &S) //初始化操作符棧的函數;
{
S.base=(char *)malloc (100*sizeof(char));
S.top=S.base;
}

void Push1(operand &S,float e) //進棧的函數;
{
*(S.top++)=e;
}

void Push2(operater &S,char e) //進棧的函數;
{
*(S.top++)=e;
}

void Pop1 (operand &S,float &t) //出棧的函數;
{
t=*(--S.top);
}

void Pop2 (operater &S,char &t) //出棧的函數;
{
t=*(--S.top);
}
char GetTop2(operater S) //取棧頂函數;
{
return *(S.top-1);
}

float GetTop1(operand S) //取棧頂函數;
{
return *(S.top-1);
}
float Operate(float a,char theta,float b) //將a,b按給定的操作符進行運算的函數;
{
switch (theta)
{
case '+': return a+b;
case '-': return a-b;
case '*': return a*b;
case '/': return a/b;
}
}

int IsOperand(char c) //判斷字元是否為操作數的部分;
{
if((c<='9'&&c>='0')||c=='.')
return 1;
return 0;
}

void ReadData(char str[100][100]) //此函數將運算符優先順序表從文件中讀入到數組str中;
{
FILE *fp;
int i;
if((fp=fopen("E:\\precede.txt","r"))==NULL) //打開文件;
{
fprintf(stderr,"can't open the file!\n");
exit(-1);
}
for(i=0;i<7;i++)
fscanf(fp,"%s%s%s%s%s%s%s",&str[i][0],&str[i][1],&str[i][2],&str[i][3],&str[i][4],&str[i][5],&str[i][6]);
fclose(fp); //關閉文件;
}

char Precede(char s,char t) //此函數比較2個操作符的優先順序,返回大小關系;
{
char st[100][100];
int i,j;
ReadData(st);
switch(s)
{
case '+': i=0;break;
case '-': i=1;break;
case '*': i=2;break;
case '/': i=3;break;
case '(': i=4;break;
case ')': i=5;break;
case '#': i=6;break;
}
switch(t)
{
case '+': j=0;break;
case '-': j=1;break;
case '*': j=2;break;
case '/': j=3;break;
case '(': j=4;break;
case ')': j=5;break;
case '#': j=6;break;
}
return st[i][j];
}

int EvaluateExpression(operand &opnd) //計算表達式的值的函數;
{
char str[100],c,x,theta;
float t=0,a,b;
int i=0,j,k,n=10,flag=1,f=0,p=1; //p用來控制操作數正負;
operater optr;
InitStack1(opnd);
InitStack2(optr);
Push2(optr,'#');
gets(str); //以字元串形式輸入表達式;
for(i=1;str[i];i++) //掃描表達式,檢查是否有負數;
if(str[i]=='-'&&str[i-1]=='(')
{
j=0;
while (str[j])
j++;
for(;j>=i;j--)
str[j+1]=str[j];
str[i]='0'; //在負數前面插入0,因為-a==0-a;

}
i=0;
if(str[i]=='-') //若第一個字元就是0;
{
p=p*(-1); //p賦為-1;
i++;
}
while(str[i]!='#'||GetTop2(optr)!='#')
{
if(str[i]==' ') { //忽略表達式中的空格;
i++;
continue;
}
if(IsOperand(str[i]))
{
f=1; //f置為1,表示已掃描到過操作數;
if(str[i]=='.') flag=0;
else
{
if(flag==0){
t=t+(float)(str[i]-48)/n; //計算小數部分的值;
n*=10;
}
else t=t*n+str[i]-48; //計算整數部分的值;
}
i++;
}

else
{
if(f==1) //操作數計算完畢,將其入操作數棧;
{
Push1(opnd,t*p);
//將各個參數還原為初始化時的值;
p=1;
t=0;
flag=1;
f=0;
n=10;
}

switch(Precede(GetTop2(optr),str[i]))
{
case '<': //不滿足運算的要求,繼續入棧;
{
Push2(optr,str[i]);
i++;
break;
}
case '=': //該對操作符中的運算已經完成,釋放該操作符;
{ Pop2(optr,x);
i++;
break;
}
case '>': //滿足運算的要求,進行運算並且將結果入操作數棧;
{
Pop2(optr,theta);
Pop1(opnd,b);
Pop1(opnd,a);
Push1(opnd,Operate(a,theta,b));
break;
}
case '0': { //錯誤的輸入,輸出錯誤提示;
printf("Grammer Error!\n");
return 0;
}
}
}
}

return 1;
}

void main ()
{
operand opnd;
int t;
printf("\n\n This programme is used for expression evaluation\n\n");
printf("Please input an expression end of '#':\n");
t=EvaluateExpression(opnd);
if(t) //無語法錯誤,輸出表達式結果;
printf("The result is: %.3f\n",GetTop1(opnd));
}

⑥ C語言編程 簡單提示

#include <stdio.h>

#define PI (3.14)
class Circle
{
public:
Circle(float r1){ r = r1;}
float r;//半徑
float getlength();//周長
float getArea();//面積
};

float Circle::getArea()
{
return PI * r*r;
}

float Circle::getlength()
{
return 2* PI * r;
}

void main()
{
Circle c(3);
printf("%f\n", c.getArea());
printf("%f\n", c.getlength());
}

⑦ 編程實現猜數游戲。 要求:設定一個目標值N,根據提示語來猜測N是多少,並記錄游戲者猜測的次數

我剛學Python ,用簡單的代碼可以實現你的這個問題


a= input("請輸入設定值N的值:")

i=1
while True:
i +=1
b=input("請輸入你要猜的數字:")
if b > a:
print("您猜的數字大了,再小點")
if b < a:
print("您猜的數字小了,再大點")
if b == a:
print("恭喜你猜對了,您總共猜了",i,"次")
break

⑧ ASP編程提示語句未結束

search sql 是什麼情況?沒有任何一個語言允許變數名當中有空格的

⑨ codeblock 在編程時提示語變少了是怎麼回事 就是以前編程時敲代碼的時候系統會自動提示的

我自己使用的感覺,不知道是否正確:
1、代碼必須要編譯過一次,即使不能完成編譯,才會記錄頭文件中的變數,類,結構體等;
2、如果沒有編譯過,只會提示你正在編寫的源代碼中的變數。
3、可以單獨編譯某個源文件,來方便代碼自動補全。

以上,你自己可以測試一下。

⑩ 單片機編程中,它提示for語句,有問題,求幫忙

把頭文件 改成小寫的 #include<reg52.h>

FOR 改成for
printf(""); 後面加上分號

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:705
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:968
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:676
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:828
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:737
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1076
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:308
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:188
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:875
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:829