题解 | #大吉大利,今晚吃鸡#

大吉大利,今晚吃鸡

https://www.nowcoder.com/practice/c9d9f9c60b4448eabc0569f80a3461bb

#include <stdio.h>
int squre(int n)
{
    int ed = 1;
    for(n;n > 0;n--)
    ed *= 3;
    return ed - 1;
}
int main() {
int n = 0;   
    int count = 0;
    while(scanf("%d",&n)!=EOF)
  {  count = squre(n);
    printf("%d \n",count);
  }  return 0;
}

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务