1

VisualStudioを使用すると次のエラーが発生します。

41 IntelliSense:識別子が必要です

私はこれが何を言おうとしているのか分かりません、そしてどんな助けもいただければ幸いです!:D

プログラムは次のとおりです。

#include <stdio.h>
#include <math.h>

int
main(void)
{
         long long d;
     long long p;

     //Ask for numbers of days as long as input is not between 28 and 31

    do
    {
    printf("How may days are in your month?\n");
    d = GetInt();
    }
    while (d<28 || d>31);


    //Ask for numbers of pennies for day 1 as long as input is negative



    printf("How many pennies do you have");
    do
    {
        p = GetInt();
    }
    while ("p<0");


    //Sum up the pennies, pennies = (pennies*2)*2..*2

    int 1;
    for (i=0; i<= d-1; i++);
        {

            p=p*pow(2,i);
        }       
    printf("%lld\n", p);
    return 0;
}`
4

2 に答える 2

6
int 1;
for (i=0; i<= d-1; i++);

これで、コンパイラはforループint 1;などの変数名を探します。最後から削除します。int x = 1;;

mainあなたが持っている最初の2行の中に

long long d;
long long p;

ここlongにタイプがあるので、それらの行を次のように変更します

long d;
long p;

あなたのファイルの終わりに私が見る}'、ここで'文字を削除します

while ("p<0");さらに、while条件として、ここに文字列があることがわかります。"p<0"これをに変更することをお勧めしますp<0

于 2013-01-15T02:54:55.583 に答える
2

あなたもおそらく交換したい

while ("p<0"); 

while(p<0);

(引用符なし)。

于 2013-01-15T02:59:49.137 に答える