#183. NOIP2014PJ-15

NOIP2014PJ-15

  1. (单选题)有以下程序
#include <iostream>
using namespace std;  
int main()  
{ 
    int s, a, n;     
    s = 0;    
    a = 1;     
    cin >> n;     
    do      
    { 
        s += 1;         
        a -= 2; 
    }while(a != n);     
    cout << s << endl;     
    return 0;  
} 

若要使程序的输出值为 2,则应该从键盘给 n 输入的值是( )

{{ select(1) }}

  • -1
  • -3
  • -5
  • 0