---
title: " 2011清华考研机试题2"
author: "Midnight0101"
date: "2011-08-09T14:56:04Z"
tags: ["考研"]
categories: ["编程语言"]
slug: "2011-2"
draft: false
lastmod: "2011-08-09T15:00:06Z"
id: 1143504
url: "https://midnight0101.iteye.com/blog/1143504"
---

\[url]http://ac.jobdu.com/problem.php?id=1087\[/url] 水~ \[code="c++"] #include #include #include using namespace std; long long solved(long long key) { long long ans=0; if(key==1) return 1; for(long long i=1;i&lt;=sqrt(key);i++) { if(key % i==0) if(i==sqrt(key)) { ans++; } else { ans+=2; } } return ans; } int main() { int n; while(cin&gt;&gt;n) { if(!n) break; for(int i=0;i