zoukankan      html  css  js  c++  java
  • poj 1250

            本来用cin cout输入输出,可不知道怎么弄得cin was not declared in this scorpe,怎么调都不行,郁闷...

    #include<iostream>
    #include
    <cstdio>
    #include
    <cstring>
    int main(){
        
    int n, d ;
        
    char a[100] ;
        
    bool v[100], e[100] ;
        
    while(scanf("%d"&n)!=EOF&&n){
            scanf(
    "%s"&a) ;
            
    int b=0 ;
            memset(v,
    0,sizeof(v)) ;
            memset(e,
    0,sizeof(e)) ;
            
    for(int i=0; i<strlen(a); i++){
                d 
    = a[i]-'A' ;
                
    if(!v[d]){
                    v[d] 
    = true ;
                    
    if(n>0){
                        n 
    -- ;
                        e[d] 
    = true ;
                    }
                    
    else b++ ;
                }
                
    else if(e[d]) n ++ ;
            }
            
    if(b==0)
                printf(
    "All customers tanned successfully.\n") ;
            
    else
                printf(
    "%d customer(s) walked away.\n", b) ;
            }
        
    return 0 ;
    }
  • 相关阅读:
    Storm中的定时任务
    Storm的acker确认机制
    ORACLE数据库表解锁record is locked by another user
    Java生成某段时间内的随机时间
    Linux中断概述
    Linux内核同步:RCU
    Linux内核同步:自旋锁
    Linux软中断、tasklet和工作队列
    Linux信号机制
    缺页异常处理
  • 原文地址:https://www.cnblogs.com/xiaolongchase/p/2175340.html
Copyright © 2011-2022 走看看